1. php与asp.net的区别
1. PHP, Hypertext Preprocessor, 动态网页开发语言。
PHP,Hypertext Preprocessor,最初在95年问世(那时以前叫Personal Home Page)。PHP最初是制作动态网页的服务器端脚本语言,但
现在PHP已经可以作为command line运行有GUI的standalone的程序。现在是PHP Group在开发和管理PHP的规则,功能等。但PHP大都用在
dynamic webpage scripting上,好象没听过谁用它开发desktop application。
PHP使用率是制作动态网页的几种语言(JSP,ASP,ASP.NET, ColdFusion, Ruby, SHTML)中最高的。因为PHP在95年已经问世至今,以有
相当数量的开发者。我们熟知的国际权威网络全书Wikipedia有90%用PHP写的,而且国外流行多年的“校内网”FaceBook 也全部用PHP写
的,同时Yahoo, Sony官方,Pepsi百事官方这些网站都是用PHP的。根据维基网络(Wikipedia)的说法,PHP被超过20,000,000的网站所
用,被超过1,000,000的网页服务器所用。目前到2008五月,PHP最新版本为5.2.6。
PHP不仅使用率高,而且能兼容各类平台。它可以在大多数网页服务器上运行(如:MS IIS,Apache),大多数操作系统上运行(如:
Windows, UNIX, linux)。而且PHP支持很大多数牌子的数据库:MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Gerneric
ODBC等。
结构方面,虽比JSP,ASP.NET差点,PHP也有很多Framework可用。微软的ASP.NET结构是出名的,JSP的MVC结构也很厉害,所以开发大网
站ASP.NET,JSP都很快。而PHP Group也为此付出很大努力,来开发自己特有的结构适应不同类型的大网站的需求。常见的PHP的
Framework有:CakePHP, PRADO, Symfony, Zend等。
另外LAMP结构,是PHP最常用的开发模式,即是配合Linux, Apache, MySQL, PHP,合称LAMP。
2. ASP(Active Server Pages), ASP.NET 两个分别是 动态网页开发语言,动态网页开发语言和结构
(1) 关于ASP的淘汰
ASP, Active Server Pages已经过时了, 但因为其出现的早,96年就有了,所以现在有些中小网站还用(但,使用最多最广的是PHP,最
初于95年现世。ASP是微软第一代动态网页开发语言,只能在Windows系统 + MS IIS服务器平台下运行。
Wikipedia, Facebook, 网络等都用PHP,PHP学习的简单度和ASP差不多;JSP稍微难点,JSP用的一般都是银行,购物等安全性较高的网站
,Google也用JSP)。但随着开发者的各种需求,ASP以后可以被ASP.NET取代,因为微软停止对其的一切技术维护与功能更新。ASP.NET是
革新版本的ASP(注意是“革新版本”,而非“改进版本”),或者说是完全新一代的Dynamic Web Scripting。
ASP代表着传统的dynamic web scripting,与ASP.NET没什么关系,学了确实也没用。因为ASP不象CGI(Common Gateway Interface),
CGI是动态网站制作的始祖,所有ASP,JSP,PHP什么的都根据CGI演化而来,而且ASP,PHP,JSP都包含了些 CGI的东西;而ASP却没有被
衍生出任何新技术,ASP.NET也不算基于ASP,只能说ASP.NET开发理念,library,功能完全是基于.NET的其它组件。
其实PHP,JSP,ASP明白其中一种,其它的都很容易学会了。如果非要学学传统的dynamic web scripting,那就学学PHP吧,不比ASP难,
但比ASP功能多,稳定性好,PHP5运行速度也比ASP快很多(JSP稍难因为要学点 java)。学了PHP或JSP什么的,对学ASP.NET有好处,而
且还可以直接用PHP,JSP进行开发。去google差差英文资源,有评价PHP 最好的,有评价JSP最好的,还从没有听谁说过ASP最好。
ASP.NET毕竟在.NET中,所以ASP.NET还是有相当地位的。
(2). 关于ASP.NET的优势
ASP.NET是微软.NET Framework的一部分。伴随.NET 1.0在2002的问世,ASP.NET也出现在动态网页开发语言的家族中(与
PHP,JSP,ColdFusion, Ruby, SHTML等并行了)。
功能上,ASP.NET比ASP有更强大的library, 更好的稳定性。 ASP.NET可以使用.NET Framework中所有组件(也就是说.NET能实现的,
ASP.NET一样能实现),功能上显然强大于传统功能单调的ASP。最强的技术支持Web Service, 而且有.NET的所有library做后盾。而且
ASP.NET 在.NET 3.5中还有微软专门为AJAX开发的功能--ASP.NET AJAX。
结构上,传统的ASP把所有代码混为一团,简单的用<%%>把HTML和VBScript(或JScript)分开,实现动态输出 HTML。因为ASP.NET模仿
JSP的MVC网页结构,微软为ASP.NET开发了自己的Code-Behind结构,将 presentation(文件拓展名:.aspx)和business logic(文件拓
展名:.cs或.vb等)分离。同时Code-Behind模式也实现了让ASP.NET开发者用.NET中最普通Winform的开发模式来开发网站,方便非网页开
发者制作动态网站。所以ASP.NET更容易维护,比ASP更适合于Enterprise Level 的大网站开发。
由于ASP.NET比JSP,PHP等更接近于.NET Winform的开发。如Tree View, Datagrid View(即高级Table)等高级UI,都可以直接用
ASP.NET中的Web Control来实现,这比传统的使用JavaScript + XTHML + CSS的DHTML开发方式简单不少,也更好维护。同时ASP.NET开发
这可以定义自己的User Control,制作自己特别的一种UI(如网站LOGO,版权等部分),而且此User Control可以被存为.ascx文件,方
便让每一页(.aspx)来使用。
运行速度上,ASP.NET模仿了JSP的预编译机制(Pre-Compile)。使编译好的代码(MSIL语言)在网页服务器上运行。这样比传统的ASP,传统
PHP(PHP4以前版本)更快,因为传统的ASP是直接运行开发者写的Script,相当于每运行一次,就得编译一次那么慢。 ASP.NET可以用
VB, C#, J#等所有.NET Framework的语言开发.(但其实每种语言做的东西都一样... 就象山东话, 东北话, 写出来都是中文:)
不过ASP.NET对出学者可能有点难. 因为它其实在模拟desktop application development,即Winforms开发的模式, 不象传统的JSP,
PHP, ASP这样容易明白。传统的Dynamic Server Scripting, 象PHP 5, 这是现在最简单的, 最有效的了。( 那个JSP也不难. 如果有钱
还可以考虑下Adobe ColdFusion。)
ASP.NET的新潮的Dynamic Server Scripting, 在其带动下SUN也推出自己的JavaServer Faces (其实是拓展JSP,但JSF无法取代JSP), 和
ASP.NET很象, 也有很多Web Control(JTable, JTree),同时JSF也曾强了对WEB SERVCIE的支持, 也很适合ENTERPRISE LEVEL 的网站。
(3). ASP与ASP.NET的优劣总结:
-- ASP已经被微软停止更新;ASP.NET却在.NET(1.0, 2.0, 3.0, 3.5)中突飞猛进;
-- ASP在96年出现,并没有引领一个潮流,PHP,ColdFusion都出现于95年,引领了整个潮流;ASP.NET引领新的动态网站开发潮流,SUN
的JSF(JavaServer Faces)就是与ASP.NET极其相似;
-- ASP大多被用在是中小网站;PHP被Wikipedia, Facebook, 网络所用,JSP被GOOGLE所用;
-- ASP不支持Web Service; ASP.NET支持Web Service。要是了解.NET中的Web Service在大组织系统中的重要性,就能立杆见影的看出差
距
-- ASP开发AJAX比较麻烦;而ASP.NET专门用AJAX控件,更方便。要是了解Web 2.0,那么AJAX是什么地位,就不用我说了吧。
-- ASP.NET模仿JSP,是pre-compile的;ASP不compile,直接运行Script的速度显然没有compile之后的快。
-- ASP.NET的唯一缺点,就是开发用的IDE--Visual Studio Professional比较贵(express版免费的功能太少);ASP的唯一优点是,其
学起来最简单,跟PHP一样简单,比JSP简单,更比ASP.NET简单几倍。
3. .NET Framework
.NET Framework的概念就大了。.NET Framework是微软开发的一种软件开发技术。主要用来开发MS Windows系统上的各类软件。.NET主要
包含一个庞大的library(解决常见编程问题)和一个virtual machine(管理程序的运行)。可以说Windows是微软的命根:),所
以.NET就是微软占领软件市场的关键。
.NET Framework的library叫做BCL, Base Class Library,包含了在各种领域的大范围的编程需要,如user interface用户界面,data
access数据接入,database connectivity, cryptography, web application development网站开发,numeric algorithms数学计算,
network communications网络交流等。开发者利用各种BSL来构成自己的代码,进而开发出多样的应用程序。
.NET写出的程序在CLR, Common Language Runtime上运行。CLR是一个application virtual machine来帮助运行开发者写的程序。CLR提
供很多重要功能,如:security安全,memory management内存管理,exception handling错误控制。
BSL,CLR构成了强大的.NET Framework。
.NET Framework主要安装在Windows Server 2008, Windows Vista。小版本的.NET Framework还安装在Windows Mobile系统上。但是家用
Windows XP等系统一样可以安装.NET Framework来运行用.NET写的程序。
平时在学校学习,通常学习.NET中的三个主要技术:Winforms(桌面应用程序开发,就是平时普通程序如QQ,Skype可以用它,但其实QQ
用C,C++写的), ASP.NET(网页,平时在IE,FireFox上看的网页可以用它), ADO.NET(接入数据库,处理相关数据)。但.NET不是一种
语言。写.NET程序可以用任何.NET支持的语言,如:C#, VB.NET, J#等等。明白其中一种就可以了。
.NET概念挺大,东西也非常非常多。与之相似的技术有SUN的Java技术(分三个技术部分Java SE, Java EE, Java ME)。
2. php源码高手请进!!!!
1、安装php运行环境
2、安装数据库
3、将网站目录指向网站源码所在的文件夹
详细步骤如下:
===========
===========
===========
Windows 2000/XP/2003 下 IIS+PHP+MySQL+Zend Optimizer+GD库+phpMyAdmin安装配置
关键词:Windows IIS下配置支持PHP+MYSQL
Apache下支持PHP的配置方法比较简单,这里就不写了
一般WIN主机推荐PHP环境组合:PHP4.4.x+MySQL4.0.x,故以下关于PHP4.4.x+MySQL4.0.x组合的安装以蓝色文字显示,如果你只需要安装PHP4.4.x+MySQL4.0.x的组合只看蓝色文字的相关内容即可
当然喜欢体验的或者WIN2003系统也可体验尝试最新的版本,推荐组合PHP5.1.x+MYSQL5.0.x/MySQL4.1.x
一、软件准备:以下均为截止2006-1-20的最新正式版本,下载地址也均长期有效
1.PHP,推荐PHP4.4.0的ZIP解压版本:
PHP(4.4.0):
http://cn.php.net/get/php-4.4.0-Win32.zip/from/a/mirror
[供选用]:
PHP(5.1.2):
http://cn.php.net/get/php-5.1.2-Win32.zip/from/a/mirror
2.MySQL,配合PHP4推荐MySQL4.0.26的WIN系统安装版本:
MySQL(4.0.26):
http://download.discuz.net/mysql-4.0.26-win32.zip
http://dev.mysql.com/get/Downloa ... p/from/pick#mirrors
[供选用]:
MySQL(4.1.16):
http://www.skycn.com/soft/24418.html
http://dev.mysql.com/get/Downloa ... p/from/pick#mirrors
MySQL(5.0.18):
http://www.skycn.com/soft/1262.html
http://dev.mysql.com/get/Downloa ... p/from/pick#mirrors
3.Zend Optimizer,当然选择当前最新版本拉:
Zend Optimizer(2.6.2):
http://www.zend.com/store/free_download.php?pid=13
(Zend软件虽然免费下载,但需要注册用户,这里提供本人注册好的帐户名:
xqincom
和密码:
xqin.com
,方便大家使用,请不要修改本帐号或将本帐户用于其他费正当途径,谢谢!)
登陆后选择Windows x86的Platform版本,如最新版本2.6.2
https://www.zend.com/store/getfreefile.php?pid=13&zbid=995
4.phpMyAdmin,当然同样选择当前最新版本拉,注意选择for Windows 的版本哦:
phpMyAdmin(2.7.0):
http://www.crsky.com/soft/4190.html
http://www.skycn.com/soft/10687.html
假设 C:\ 为你现在所使用操作系统的系统盘,如果你目前操作系统不是安装在 C:\ ,请自行对应修改相应路径。同时由于C盘经常会因为各种原因重装系统,数据放在该盘不易备份和转移
选择安装目录,故本文将所有PHP相关软件均安装到D:\php目录下,这个路径你可以自行设定,如果你安装到不同目录涉及到路径的请对应修改以下的对应路径即可
二、安装 PHP :本文PHP安装路径取为D:\php\php4\
(为避混淆,PHP5.1.x版本安装路径取为D:\php\php5\)
(1)、下载后得到 php-4.4.0-Win32.zip ,解压至D:\php目录,将得到二级目录php-4.4.0-Win32,改名为 php4,也即得到PHP文件存放目录D:\php\php4\[如果是PHP5.1.2,得到的文件是php-5.1.2-Win32.zip,直接全 部接压至D:\php\php5目录即可得PHP文件存放目录D:\php\php5\
];
(2)、再将D:\php\php4目录和D:\php\php4\dlls目录[
PHP5为D:\php\php5\
]下的所有dll文件拷到c:\Windows\system32(win2000系统为 c:/winnt/system32/)下,覆盖已有的dll文件;
(3)、将php.ini-dist用记事本打开,利用记事本的查找功能搜索并修改:
搜索
CODE:
[Copy to clipboard]
register_globals = Off,将 Off 改成 On ,即得到register_globals = On;
注:这个对应PHP的全局变量功能,考虑有很多PHP程序需要全局变量功能故打开,打开后请注意-PHP程序的严谨性,如果不需要推荐不修改保持默认Off状态
再搜索
CODE:
[Copy to clipboard]
extension_dir =,并将其路径指到你的 PHP 目录下的 extensions 目录,比如:修改extension_dir = "./"为extension_dir = "D:/php/php4/extensions/" ;
PHP扩展功能目录[PHP5对应修改为extension_dir = "D:/php/php5/ext/"]
在D:\php下建立文件夹并命名为tmp
查找
CODE:
[Copy to clipboard]
;upload_tmp_dir =将;upload_tmp_dir该行的注释符,即前面的分号“;”去掉,使该行在php.ini文档中起作用。upload_tmp_dir是用来定 义上传文件存放的临时路径,在这里你还可以修改并给其定义一个绝对路径,这里设置的目录必须有读写权限。
这里我设置为upload_tmp_dir = D:/php/tmp (即前面建立的这个文件夹呵)
搜索找到
CODE:
[Copy to clipboard]
;Windows Extensions将下面一些常用的项前面的;去掉
CODE:
[Copy to clipboard]
;extension=php_mbstring.dll
CODE:
[Copy to clipboard]
;extension=php_curl.dll
CODE:
[Copy to clipboard]
;extension=php_dbase.dll
CODE:
[Copy to clipboard]
;extension=php_gd2.dll
这个是用来支持GD库的,一般需要,必选
CODE:
[Copy to clipboard]
;extension=php_ldap.dll
CODE:
[Copy to clipboard]
extension=php_zip.dll去掉前面的";"
对于PHP5的版本还需要查找
CODE:
[Copy to clipboard]
;extension=php_mysql.dll并同样去掉前面的";"
这个是用来支持MYSQL的,由于PHP5将MySQL作为一个独立的模块来加载运行的,故要支持MYSQL必选
查找
CODE:
[Copy to clipboard]
;session.save_path =去掉前面;号,本文这里将其设置置为
session.save_path = D:/php/tmp
其他的你可以选择需要的去掉前面的;然后将该文件另存为为php.ini到C:\Windows ( Windows 2000 下为 C:\WINNT)目录下,注意更改文件后缀名为ini,得到C:\Windows\php.ini ( Windows 2000 下为 C:\WINNT\php.ini)
本人配置成功后的PHP.INI文件示例可供大家参考:
http://xqin.com/iis/php4/php.ini
对应版本为PHP4.4.0
http://xqin.com/iis/php5/php.ini
对应版本为PHP5.1.12
若路径等和本文相同可直接保存到C:\Windows ( Windows 2000 下为 C:\WINNT)目录下使用若路径等和本文相同可直接保存到C:\Windows ( Windows 2000 下为 C:\WINNT)目录下使用
一些朋友经常反映无法上传较大的文件或者运行某些程序经常超时,那么可以找到C:\Windows ( Windows 2000 下为 C:\WINNT)目录下的PHP.INI以下内容修改:
max_execution_time = 30 ; 这个是每个脚本运行的最长时间,可以自己修改加长,单位秒
max_input_time = 60 ; 这是每个脚本可以消耗的时间,单位也是秒
memory_limit = 8M ; 这个是脚本运行最大消耗的内存,也可以自己加大
upload_max_filesize = 2M ; 上载文件的最大许可大小 ,自己改吧,一些图片论坛需要这个更大的值
(4)、配置 IIS 使其支持 PHP :
首先必须确定系统中已经正确安装 IIS ,如果没有安装,需要先安装 IIS ,安装步骤如下:
Windows 2000/XP 下的 IIS 安装:
用 Administrator 帐号登陆系统,将 Windows 2000 安装光盘插入光盘驱动器,进入“控制面板”点击“添加/删除程序”,再点击左侧的“添加/删除 Windows 组件”,在弹出的窗口中选择“Internet 信息服务(IIS)”,点下面的“详细信息”按钮,选择组件,以下组件是必须的:“Internet 服务管理器”、“World Wide Web 服务器”和“公用文件”,确定安装。
安装完毕后,在“控制面板”的“管理工具”里打开“服务”,检查“IIS Admin Service”和“World Wide Web Publishing Service”两项服务,如果没有启动,将其启动即可。
Windows 2003 下的 IIS 安装:
由于 Windows 2003 的 IIS 6.0 集成在应用程序服务器中,因此安装应用程序服务器就会默认安装 IIS 6.0 ,在“开始”菜单中点击“配置您的服务器”,在打开的“配置您的服务器向导”里左侧选择“应用程序服务器(IIS,ASP.NET)”,单击“下一步”出 现“应用程序服务器选项”,你可以选择和应用程序服务器一起安装的组件,默认全选即可,单击“下一步”,出现“选择总结界面”,提示了本次安装中的选项, 配置程序将自动按照“选择总结”中的选项进行安装和配置。
打开浏览器,输入:
http://localhost/
,看到成功页面后进行下面的操作:
PHP 支持 CGI 和 ISAPI 两种安装模式,CGI 更消耗资源,容易因为超时而没有反映,但是实际上比较安全,负载能力强,节省资源,但是安全性略差于CGI,本人推荐使用 ISAPI 模式。故这里只解介绍 ISAPI 模式安装方法:(以下的截图因各个系统不同,窗口界面可能不同,但对应选项卡栏目是相同的,只需找到提到的对应选项卡即可)
在“控制面板”的“管理工具”中选择“Internet 服务管理器”,打开 IIS 后停止服务,对于WIN2000系统在”Internet 服务管理器“的下级树一般为你的”计算机名“上单击右键选择“属性”,再在属性页面选择主属性”WWW 服务“右边的”编辑“
对于XP/2003系统展开”Internet 服务管理器“的下级树一般为你的”计算机名“选择”网站“并单击右键选择“属性”
在弹出的属性窗口上选择“ISAPI 筛选器”选项卡找到并点击“添加”按钮,在弹出的“筛选器属性”窗口中的“筛选器名称”栏中输入:PHP ,再将浏览可执行文件使路径指向 php4isapi.dll 所在路径,如本文中为:D:\php\php4\sapi\php4isapi.dll[PHP5对应路径为D:\php\php5\ php5isapi.dll
]。
打开“站点属性”窗口的“主目录”选项卡,找到并点击“配置”按钮
在弹出的“应用程序配置”窗口中的”应用程序映射“选项卡找到并点击“添加”按钮新增一个扩展名映射,在弹出的窗口中单击“浏览”将可执行文件指向 php4isapi.dll 所在路径,如本文中为:D:\php\php4\sapi\php4isapi.dll[
PHP5对应路径为D:\php\php5\php5isapi.dll
],扩展名为 .php ,动作限于”GET,HEAD,POST,TRACE“,将“脚本引擎”“确认文件是否存在”选中,然后一路确定即可。如果还想支持诸如 .php3 ,.phtml 等扩展名的 PHP 文件,可以重复“添加”步骤,对应扩展名设置为需要的即可如.PHPX。
此步操作将使你服务器IIS下的所有站点都支持你所添加的PHP扩展文件,当然如果你只需要部分站点支持PHP,只需要在“你需要支持PHP的Web站 点”比如“默认Web站点”上单击右键选择“属性”,在打开的“ Web 站点属性”“主目录”选项卡,编辑或者添加PHP的扩展名映射即可或者将你步需要支持PHP的站点中的PHP扩展映射删除即可
再打开“站点属性”窗口的“文档”选项卡,找到并点击“添加”按钮,向默认的 Web 站点启动文档列表中添加 index.php 项。您可以将 index.php 升到最高优先级,这样,访问站点时就会首先自动寻找并打开 index.php 文档。
确定 Web 目录的应用程序设置和执行许可中选择为纯脚本,然后关闭 Internet 信息服务管理器
对于2003系统还需要在“Internet 服务管理器”左边的“WEB服务扩展”中设置ISAPI 扩展允许,Active Server Pages 允许
完成所有操作后,重新启动IIS服务。
在CMD命令提示符中执行如下命令:
net stop w3svc
net stop iisadmin
net start w3svc
到此,PHP的基本安装已经完成,我们已经使网站支持PHP脚本。
检查方法是,在 IIS 根目录下新建一个文本文件存为 php.php ,内容如下:
CODE:
[Copy to clipboard]
打开浏览器,输入:
http://localhost/php.php
,将显示当前服务器所支持 PHP 的全部信息,可以看到 Server API的模式为:ISAPI 。
或者利用PHP探针检测
http://xqin.com/index.rar
下载后解压到你的站点根目录下并访问即可
三、安装 MySQL :
对于MySQL4.0.26下载得到的是mysql-4.0.26-win32.zip,解压到mysql-4.0.26-win32目录双击执行 Setup.exe 一路Next下一步,选择安装目录为D:\php\MySQL和安装方式为Custom自定义安装,再一路Next下一步即可。
安装完毕后,在CMD命令行中输入并运行:
CODE:
[Copy to clipboard]
D:\php\MySQL\bin\mysqld-nt -install如果返回Service successfully installed.则说明系统服务成功安装
新建一文本文件存为MY.INI,编辑配置MY.INI,这里给出一个参考的配置
(
http://xqin.com/iis/my.ini
可以下载后直接保存到WINDOWS或者WINNT目录使用)
CODE:
[Copy to clipboard]
[mysqld]
basedir=D:/php/MySQL
#MySQL所在目录
datadir=D:/php/MySQL/data
#MySQL数据库所在目录,可以更改为其他你存放数据库的目录
#language=D:/php/MySQL/share/your language directory
#port=3306
set-variable = max_connections=800
skip-locking
set-variable = key_buffer=512M
set-variable = max_allowed_packet=4M
set-variable = table_cache=1024
set-variable = sort_buffer=2M
set-variable = thread_cache=64
set-variable = join_buffer_size=32M
set-variable = record_buffer=32M
set-variable = thread_concurrency=8
set-variable = myisam_sort_buffer_size=64M
set-variable = connect_timeout=10
set-variable = wait_timeout=10
server-id = 1
[isamchk]
set-variable = key_buffer=128M
set-variable = sort_buffer=128M
set-variable = read_buffer=2M
set-variable = write_buffer=2M
[myisamchk]
set-variable = key_buffer=128M
set-variable = sort_buffer=128M
set-variable = read_buffer=2M
set-variable = write_buffer=2M
[WinMySQLadmin]
Server=D:/php/MySQL/bin/mysqld-nt.exe保存后复制此MY.INI文件到C:\Windows ( Windows 2000 下为 C:\WINNT)目录下
回到CMD命令行中输入并运行:
CODE:
[Copy to clipboard]
net start mysqlMySQL 服务正在启动 .
MySQL 服务已经启动成功。
将启动 MySQL 服务;
DOS下修改ROOT密码:当然后面安装PHPMYADMIN后修改密码也可以通过PHPMYADMIN修改
格式:mysqladmin -u用户名 -p旧密码 password 新密码
例:给root加个密码xqin.com
首先在进入CMD命令行,转到MYSQL目录下的bin目录,然后键入以下命令
mysqladmin -uroot password xqin.com
注:因为开始时root没有密码,所以-p旧密码一项就可以省略了。
D:\php\MySQL\bin>mysqladmin -uroot password xqin.com回车后ROOT密码就设置为xqin.com了
如果你下载的是 MySQL5.x或者MySQL4.1.x,例mysql-5.0.18-win32:解压后双击执行 Setup.exe ,Next下一步后选择Custom自定义安装,再Next下一步选择安装路径这里我们选择D:\php\MySQL,继续Next下一步跳过Sign UP完成安装。
安装完成后会提示你是不是立即进行配置,选择是即可进行配置。当然一般安装后菜单里面也有配置向导MySQL Server Instance Config Wizar,运行后按下面步骤配置并设置ROOT密码即可
Next下一步后选择Standard Configuration
Next下一步,钩选Include .. PATH
Next下一步,设置ROOT密码,建议社设置复杂点,确保服务器安全!
Apply完成后将在D:\php\MySQL目录下生成MY.INI配置文件,添加并启动MySQL服务
如果你的MySQL安装出错,并且卸载重装仍无法解决,这里提供一个小工具系统服务管理器
http://xqin.com/iis/ser.rar
,用于卸载后删除存在的MYSQL服务,重起后再按上述说明进行安装一般即可成功安装
四、安装 Zend Optimizer :
下载后得到 ZendOptimizer-2.6.2-Windows-i386.exe ,直接双击安装即可,安装过程要你选择 Web Server 时,选择 IIS ,然后提示你是否 Restart Web Server,选择是,完成安装之前提示是否备份 php.ini ,点确定后安装完成。我这里安装到D:\php\Zend
以下两步的目录根据你自己的默认WEB站点目录来选,当然也可以选择到D:\php\Zend目录
Zend Optimizer 的安装向导会自动根据你的选择来修改 php.ini 帮助你启动这个引擎。下面简单介绍一下 Zend Optimizer 的配置选项。以下为本人安装完成后 php.ini 里的默认配置代码(分号后面的内容为注释):
zend_extension_ts="D:\php\Zend\lib\ZendExtensionManager.dll"
;Zend Optimizer 模块在硬盘上的安装路径。
zend_extension_manager.optimizer_ts="D:\php\Zend\lib\Optimizer-2.6.2"
;优化器所在目录,默认无须修改。
zend_optimizer.optimization_level=1023
;优化程度,这里定义启动多少个优化过程,默认值是 15 ,表示同时开启 10 个优化过程中的 1-4 ,我们可以将这个值改为 1023 ,表示开启全部10个优化过程。
调用phpinfo()函数后显示:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with Zend Extension Manager v1.0.9, Copyright (c) 2003-2006, by Zend Technologies with Zend Optimizer v2.6.2, Copyright (c) 1998-2006, by Zend Technologies 则表示安装成功。
3. php language level选择哪一个
肯定选PHP了,现在都主流这个了。
4. 【求助】安装并且配置好apache+php+mysql之后该咋办捏
#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://www.apache.org/docs/> for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
#
# After this file is processed, the server will look for and process
# C:/Apache/Apache/conf/srm.conf and then C:/Apache/Apache/conf/access.conf
# unless you have overridden these with ResourceConfig and/or
# AccessConfig directives here.
#
# The configuration directives are grouped into three basic sections:
# 1. Directives that control the operation of the Apache server process as a
# whole (the 'global environment').
# 2. Directives that define the parameters of the 'main' or 'default' server,
# which responds to requests that aren't handled by a virtual host.
# These directives also provide default values for the settings
# of all virtual hosts.
# 3. Settings for virtual hosts, which allow Web requests to be sent to
# different IP addresses or hostnames and have them handled by the
# same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
# with ServerRoot set to "/usr/local/apache" will be interpreted by the
# server as "/usr/local/apache/logs/foo.log".
#
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
# If a drive letter is omitted, the drive on which Apache.exe is located
# will be used by default. It is recommended that you always supply
# an explicit drive letter in absolute paths, however, to avoid
# confusion.
#
### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#
#
# ServerType is either inetd, or standalone. Inetd mode is only supported on
# Unix platforms.
#
ServerType standalone
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
ServerRoot "C:/Apache/Apache"
#
# PidFile: The file in which the server should record its process
# identification number when it starts.
#
PidFile logs/httpd.pid
#
# ScoreBoardFile: File used to store internal server process information.
# Not all architectures require this. But if yours does (you'll know because
# this file will be created when you run Apache) then you *must* ensure that
# no two invocations of Apache share the same scoreboard file.
#
ScoreBoardFile logs/apache_runtime_status
#
# In the standard configuration, the server will process httpd.conf (this
# file, specified by the -f command line option), srm.conf, and access.conf
# in that order. The latter two files are now distributed empty, as it is
# recommended that all directives be kept in a single file for simplicity.
# The commented-out values below are the built-in defaults. You can have the
# server ignore these files altogether by using "/dev/null" (for Unix) or
# "nul" (for Win32) for the arguments to the directives.
#
#ResourceConfig conf/srm.conf
#AccessConfig conf/access.conf
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300
#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On
#
# MaxKeepAliveRequests: The maximum number of requests to allow
# ring a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100
#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15
#
# Apache on Win32 always creates one child process to handle requests. If it
# dies, another child process is created automatically. Within the child
# process multiple threads handle incoming requests. The next two
# directives control the behaviour of the threads and processes.
#
#
# MaxRequestsPerChild: the number of requests each child process is
# allowed to process before the child dies. The child will exit so
# as to avoid problems after prolonged use when Apache (and maybe the
# libraries it uses) leak memory or other resources. On most systems, this
# isn't really needed, but a few (such as Solaris) do have notable leaks
# in the libraries. For Win32, set this value to zero (unlimited)
# unless advised otherwise.
#
# NOTE: This value does not include keepalive requests after the initial
# request per connection. For example, if a child process handles
# an initial request and 10 subsequent "keptalive" requests, it
# would only count as 1 request towards this limit.
#
MaxRequestsPerChild 0
#
# Number of concurrent threads (i.e., requests) the server will allow.
# Set this value according to the responsiveness of the server (more
# requests active at once means they're all handled more slowly) and
# the amount of system resources you'll allow the server to consume.
#
ThreadsPerChild 50
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
#Listen 3000
#Listen 12.34.56.78:80
#
# BindAddress: You can support virtual hosts with this option. This directive
# is used to tell the server which IP address to listen to. It can either
# contain "*", an IP address, or a fully qualified Internet domain name.
# See also the <VirtualHost> and Listen directives.
#
#BindAddress *
#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a mole which was built as a DSO you
# have to place corresponding `LoadMole' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Please read the file README.DSO in the Apache 1.3 distribution for more
# details about the DSO mechanism and run `apache -l' for the list of already
# built-in (statically linked and thus always available) moles in your Apache
# binary.
#
# Note: The order in which moles are loaded is important. Don't change
# the order below without expert advice.
#
# Example:
# LoadMole foo_mole moles/mod_foo.so
#
#LoadMole vhost_alias_mole moles/mod_vhost_alias.so
#LoadMole mime_magic_mole moles/mod_mime_magic.so
#LoadMole status_mole moles/mod_status.so
#LoadMole info_mole moles/mod_info.so
#LoadMole speling_mole moles/mod_speling.so
#LoadMole rewrite_mole moles/mod_rewrite.so
#LoadMole anon_auth_mole moles/mod_auth_anon.so
#LoadMole dbm_auth_mole moles/mod_auth_dbm.so
#LoadMole digest_auth_mole moles/mod_auth_digest.so
#LoadMole digest_mole moles/mod_digest.so
#LoadMole proxy_mole moles/mod_proxy.so
#LoadMole cern_meta_mole moles/mod_cern_meta.so
#LoadMole expires_mole moles/mod_expires.so
#LoadMole headers_mole moles/mod_headers.so
#LoadMole usertrack_mole moles/mod_usertrack.so
#LoadMole unique_id_mole moles/mod_unique_id.so
#
# Reconstruction of the complete mole list from all available moles
# (static and shared ones) to achieve correct mole execution order.
#
# The moles listed below, without a corresponding LoadMole directive,
# are static bound into the standard Apache binary distribution for Windows.
#
# Note: The order in which moles are loaded is important. Don't change
# the order below without expert advice.
#
# [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE, UPDATE THIS TOO!]
ClearMoleList
#AddMole mod_vhost_alias.c
AddMole mod_env.c
AddMole mod_log_config.c
#AddMole mod_mime_magic.c
AddMole mod_mime.c
AddMole mod_negotiation.c
#AddMole mod_status.c
#AddMole mod_info.c
AddMole mod_include.c
AddMole mod_autoindex.c
AddMole mod_dir.c
AddMole mod_isapi.c
AddMole mod_cgi.c
AddMole mod_asis.c
AddMole mod_imap.c
AddMole mod_actions.c
#AddMole mod_speling.c
AddMole mod_userdir.c
AddMole mod_alias.c
#AddMole mod_rewrite.c
AddMole mod_access.c
AddMole mod_auth.c
#AddMole mod_auth_anon.c
#AddMole mod_auth_dbm.c
#AddMole mod_auth_digest.c
#AddMole mod_digest.c
#AddMole mod_proxy.c
#AddMole mod_cern_meta.c
#AddMole mod_expires.c
#AddMole mod_headers.c
#AddMole mod_usertrack.c
#AddMole mod_unique_id.c
AddMole mod_so.c
AddMole mod_setenvif.c
#
# ExtendedStatus controls whether Apache will generate "full" status
# information (ExtendedStatus On) or just basic information (ExtendedStatus
# Off) when the "server-status" handler is called. The default is Off.
#
#ExtendedStatus On
### Section 2: 'Main' server configuration
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition. These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#
#
# Port: The port to which the standalone server listens. Certain firewall
# procts must be configured before Apache can listen to a specific port.
# Other running httpd servers will also interfere with this port. Disable
# all firewall, security, and other services if you encounter problems.
# To help diagnose problems use the Windows NT command NETSTAT -a
#
Port 80
#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents.
#
ServerAdmin [email protected]
#
# ServerName allows you to set a host name which is sent back to clients for
# your server if it's different than the one the program would get (i.e., use
# "www" instead of the host's real name).
#
# Note: You cannot just invent host names and hope they work. The name you
# define here must be a valid DNS name for your host. If you don't understand
# this, ask your network administrator.
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address (e.g., http://123.45.67.89/)
# anyway, and this will make redirections work in a sensible way.
#
# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your
# machine always knows itself by this address. If you use Apache strictly for
# local testing and development, you may use 127.0.0.1 as the server name.
#
ServerName localhost
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "C:/Apache/Apache/htdocs"
#
# Each directory to which Apache has access, can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# permissions.
#
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "C:/Apache/Apache/htdocs">
#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
Options Indexes FollowSymLinks MultiViews
#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
#
# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is received.
#
# Under Win32, we do not currently try to determine the home directory of
# a Windows login, so a format such as that below needs to be used. See
# the UserDir documentation for details.
#
<IfMole mod_userdir.c>
UserDir "C:/Apache/Apache/users/"
</IfMole>
#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
#<Directory "C:/Apache/Apache/users">
# AllowOverride FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
# <Limit GET POST OPTIONS PROPFIND>
# Order allow,deny
# Allow from all
# </Limit>
# <LimitExcept GET POST OPTIONS PROPFIND>
# Order deny,allow
# Deny from all
# </LimitExcept>
#</Directory>
#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
<IfMole mod_dir.c>
DirectoryIndex index.html
</IfMole>
#
# AccessFileName: The name of the file to look for in each directory
# for access control information.
#
AccessFileName .htaccess
#
# The following lines prevent .htaccess files from being viewed by
# Web clients. Since .htaccess files often contain authorization
# information, access is disallowed for security reasons. Comment
# these lines out if you want Web visitors to see the contents of
# .htaccess files. If you change the AccessFileName directive above,
# be sure to make the corresponding changes here.
#
# Also, folks tend to use names such as .htpasswd for password
# files, so this will protect those as well.
#
<Files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</Files>
#
# CacheNegotiatedDocs: By default, Apache sends "Pragma: no-cache" with each
# document that was negotiated on the basis of content. This asks proxy
# servers not to cache the document. Uncommenting the following line disables
# this behavior, and proxies will be allowed to cache the documents.
#
#CacheNegotiatedDocs
#
# UseCanonicalName: (new for 1.3) With this setting turned on, whenever
# Apache needs to construct a self-referencing URL (a URL that refers back
# to the server the response is coming from) it will use ServerName and
# Port to form a "canonical" name. With this setting off, Apache will
# use the hostname:port that the client supplied, when possible. This
# also affects SERVER_NAME and SERVER_PORT in CGI scripts.
#
UseCanonicalName On
#
# TypesConfig describes where the mime.types file (or equivalent) is
# to be found.
#
<IfMole mod_mime.c>
TypesConfig conf/mime.types
</IfMole>
#
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value. If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain
#
# The mod_mime_magic mole allows the server to use various hints from the
# contents of the file itself to determine its type. The MIMEMagicFile
# directive tells the mole where the hint definitions are located.
# mod_mime_magic is not part of the default server (you have to add
# it yourself with a LoadMole [see the DSO paragraph in the 'Global
# Environment' section], or recompile the server and include mod_mime_magic
# as part of the configuration), so it's enclosed in an <IfMole> container.
# This means that the MIMEMagicFile directive will only be processed if the
# mole is part of the server.
#
<IfMole mod_mime_magic.c>
MIMEMagicFile conf/magic
</IfMole>
#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off
#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog logs/error.log
#
# LogLevel: Control the number of messages logged to the error.log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here. Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
CustomLog logs/access.log common
#
# If you would like to have agent and referer logfiles, uncomment the
# following directives.
#
#CustomLog logs/referer.log referer
#CustomLog logs/agent.log agent
#
# If you prefer a single logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
#CustomLog logs/access.log combined
#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (error documents, FTP directory listings,
# mod_status and mod_info output etc., but not CGI generated documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of: On | Off | EMail
#
ServerSignature On
#
# Apache parses all CGI scripts for the shebang line by default.
# This comment line, the first line of the script, consists of the symbols
# pound (#) and exclamation (!) followed by the path of the program that
# can execute this specific script. For a perl script, with perl.exe in
# the C:\Program Files\Perl directory, the shebang line should be:
#!c:/program files/perl/perl
# Note you _must_not_ indent the actual shebang line, and it must be the
# first line of the file. Of course, CGI processing must be enabled by
# the appropriate ScriptAlias or Options ExecCGI directives for the files
# or directory in question.
#
# However, Apa
5. 高分求phpmyfaq的详细教程
phpmyfaq安装说明
安装演示版本号:phpmyfaq 2.6.11
教程使用的上传工具:FlashFXP
教程使用的环境:无忧主机php虚拟主机
教程使用临时调试域名:http://test.hk1123.51php.com/phpmyfaq
二、phpmyfaq安装包上传和在线解压
使用flashFXP将压缩包上传到网站根目录下,然后在线解压到网站根目录。关于如何在无忧php虚拟主机中上传数据并在线解压,我之前已经写过相关教程了,这里不重复叙述了,有需要教程用户可以点击深入详解无忧php空间如何上传网站数据进行查看。
三、文件目录权限修改方法
在纯linux环境下安装phpmyfaq问答系统,务必请用户参照无忧主机站点目录(public_html)文件夹的权限设置中介绍的文件目录权限设置的方法,将phpmyfaq根目录和./config两个目录权限设置为777, 否则在安装过程会提示错误,无法正确完成安装。
四、phpmyfaq详细安装步骤
Phpmyfaq的安装安装是非常简洁的,由于phpmyfaq是全英文安装界面,为方便用户安装和了解每个安装步骤的含义,我特意将部分phpmyfaq安装文件进行了翻译,供用户参考。如果熟练安装只需要10分钟左右,就可以完成phpmyfaq的安装详细安装步骤如下:
1、 运行域名(http://test.hk1123.51php.com/phpmyfaq)启动安装向导。
2、 配置mysql数据库连接和管理员信息。
A、Please add your database connection setup information 请添加数据库信息
SQL server host:localhost (数据库连接方式,本地连接)
SQL username: 51php_51php.com (数据库访问用户名)
SQL password: ******** (数据库密码)
SQL database: www_51php (数据库名称)
Table preflx: phpfaq_ (数据库表前缀名)
B、phpMYFAQ information phpmyfaq基本信息设置
Default language:chinese(simplified) (简体中文)
Permission level: 选择默认
Admin’s real name: administrator (管理员真实名称)
Admin’s e-mail address: [email protected] (管理员邮箱)
Admin’s username: admin (管理员用户名)
Admin’s password: ***** (管理员密码)
Retype password:***** (重复管理员密码)
phpmyfaq开源问答(FAQ)系统快速安装教程 image00113 150x150
请用户对照图片和安装界面的翻译,正确填写mysql数据库信息,设置phpmyfaq的管理员帐号、选择简体中文语言包。如果确认无误后,请点击“Click to install phpMYFAQ 2.6.11”继续安装。
3、 等待几分钟,phpmyfaq就安装完成了。安装完成后phpmyfaq安装向导会弹出一个调查问卷,如果你不想参与调查问卷,就直接点击:“your version of phpMYFAQ”登录phpmyfaq首页。
phpmyfaq开源问答(FAQ)系统快速安装教程 image00310 150x150
4、删除install目录!phpmyfaq安装成功!
phpmyfaq开源问答(FAQ)系统快速安装教程 image0058 150x150
5、如果你有兴趣参与phpmyFAQ的官方调查问卷,无忧主机(www.51php.com)已经将调查问卷的内容翻译如下,请用户自行对照。
database tables were successfully created. 所有数据库表都已经成功建立
Congratulation! Everything seems to be okay. 恭喜你!安装完成
窗体顶端
For further development we would like to get some feedback from our users. 了更好发展,我们渴望从您那里得到宝贵的建议:
Therefore we’d ask you to take a few minutes of your time to answer a few questions. 耽误你几分钟,回到我们几个提问:
If you don’t want to participate in the survey, you can directly visit your version of phpMyFAQ or login into your admin section. 如果你不想参阅调查,你可以直接访问你的网站phpmyfaq,或者登录你的管理后台
Please delete the file ./install/setup.php manually.
请删除文件:./install/setup.php
Please delete the file ./install/update.php manually.
请删除文件:./install/update.php
无忧主机提供美国/香港 纯Linux环境下高端php空间产品,只需99元起,有需求的用户请联系无忧主机客服。
6. php安装的问题,无法载入 mysql 扩展,请检查 PHP 配置
首先你需要将PHP安装目录下的php_mysql.dll和php_mysqli.dll(我的在D:\apptools\php5\ext目录下)复制到c:\windows\system32目录下,然后修改php.ini文件(需要放到c:\windows目录下),关键是extension=php_mysql.dll 和extension_dir = "D:/apptools/php5/ext"。
我的配置是这样的:
[PHP]
;;;;;;;;;;;
; WARNING ;
;;;;;;;;;;;
; This is the default settings file for new PHP installations.
; By default, PHP installs itself with a configuration suitable for
; development purposes, and *NOT* for proction purposes.
; For several security-oriented considerations that should be taken
; before going online with your site, please consult php.ini-recommended
; and http://php.net/manual/en/security.php.
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; This file controls many aspects of PHP's behavior. In order for PHP to
; read it, it must be named 'php.ini'. PHP looks for it in the current
; working directory, in the path designated by the environment variable
; PHPRC, and in the path that was defined in compile time (in that order).
; Under Windows, the compile-time path is the Windows directory. The
; path in which the php.ini file is looked for can be overridden using
; the -c argument in command line mode.
;
; The syntax of the file is extremely simple. Whitespace and Lines
; beginning with a semicolon are silently ignored (as you probably guessed).
; Section headers (e.g. [Foo]) are also silently ignored, even though
; they might mean something in the future.
;
; Directives are specified using the following syntax:
; directive = value
; Directive names are *case sensitive* - foo=bar is different from FOO=bar.
;
; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one
; of the INI constants (On, Off, True, False, Yes, No and None) or an expression
; (e.g. E_ALL & ~E_NOTICE), or a quoted string ("foo").
;
; Expressions in the INI file are limited to bitwise operators and parentheses:
; | bitwise OR
; & bitwise AND
; ~ bitwise NOT
; ! boolean NOT
;
; Boolean flags can be turned on using the values 1, On, True or Yes.
; They can be turned off using the values 0, Off, False or No.
;
; An empty string can be denoted by simply not writing anything after the equal
; sign, or by using the None keyword:
;
; foo = ; sets foo to an empty string
; foo = none ; sets foo to an empty string
; foo = "none" ; sets foo to the string 'none'
;
; If you use constants in your value, and these constants belong to a
; dynamically loaded extension (either a PHP extension or a Zend extension),
; you may only use these constants *after* the line that loads the extension.
;
;
;;;;;;;;;;;;;;;;;;;
; About this file ;
;;;;;;;;;;;;;;;;;;;
; All the values in the php.ini-dist file correspond to the builtin
; defaults (that is, if no php.ini is used, or if you delete these lines,
; the builtin defaults will be identical).
;;;;;;;;;;;;;;;;;;;;
; Language Options ;
;;;;;;;;;;;;;;;;;;;;
; Enable the PHP scripting language engine under Apache.
engine = On
; Enable compatibility mode with Zend Engine 1 (PHP 4.x)
zend.ze1_compatibility_mode = Off
; Allow the <? tag. Otherwise, only <?php and <script> tags are recognized.
; NOTE: Using short tags should be avoided when developing applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable code,
; be sure not to use short tags.
short_open_tag = On
; Allow ASP-style <% %> tags.
asp_tags = Off
; The number of significant digits displayed in floating point numbers.
precision = 12
; Enforce year 2000 compliance (will cause problems with non-compliant browsers)
y2k_compliance = On
; Output buffering allows you to send header lines (including cookies) even
; after you send body content, at the price of slowing PHP's output layer a
; bit. You can enable output buffering ring runtime by calling the output
; buffering functions. You can also enable output buffering for all files by
; setting this directive to On. If you wish to limit the size of the buffer
; to a certain size - you can use a maximum number of bytes instead of 'On', as
; a value for this directive (e.g., output_buffering=4096).
output_buffering = On
; You can redirect all of the output of your scripts to a function. For
; example, if you set output_handler to "mb_output_handler", character
; encoding will be transparently converted to the specified encoding.
; Setting any output handler automatically turns on output buffering.
; Note: People who wrote portable scripts should not depend on this ini
; directive. Instead, explicitly set the output handler using ob_start().
; Using this ini directive may cause problems unless you know what script
; is doing.
; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler"
; and you cannot use both "ob_gzhandler" and "zlib.output_compression".
; Note: output_handler must be empty if this is set 'On' !!!!
; Instead you must use zlib.output_handler.
;output_handler =
; Transparent output compression using the zlib library
; Valid values for this option are 'off', 'on', or a specific buffer size
; to be used for compression (default is 4KB)
; Note: Resulting chunk size may vary e to nature of compression. PHP
; outputs chunks that are few hundreds bytes each as a result of
; compression. If you prefer a larger chunk size for better
; performance, enable output_buffering in addition.
; Note: You need to use zlib.output_handler instead of the standard
; output_handler, or otherwise the output will be corrupted.
zlib.output_compression = Off
; You cannot specify additional output handlers if zlib.output_compression
; is activated here. This setting does the same as output_handler but in
; a different order.
;zlib.output_handler =
; Implicit flush tells PHP to tell the output layer to flush itself
; automatically after every output block. This is equivalent to calling the
; PHP function flush() after each and every call to print() or echo() and each
; and every HTML block. Turning this option on has serious performance
; implications and is generally recommended for debugging purposes only.
implicit_flush = Off
; The unserialize callback function will be called (with the undefined class'
; name as parameter), if the unserializer finds an undefined class
; which should be instantiated.
; A warning appears if the specified function is not defined, or if the
; function doesn't include/implement the missing class.
; So only set this entry, if you really want to implement such a
; callback-function.
unserialize_callback_func=
; When floats & doubles are serialized store serialize_precision significant
; digits after the floating point. The default value ensures that when floats
; are decoded with unserialize, the data will remain the same.
serialize_precision = 100
; Whether to enable the ability to force arguments to be passed by reference
; at function call time. This method is deprecated and is likely to be
; unsupported in future versions of PHP/Zend. The encouraged method of
; specifying which arguments should be passed by reference is in the function
; declaration. You're encouraged to try and turn this option Off and make
; sure your scripts work properly with it in order to ensure they will work
; with future versions of the language (you will receive a warning each time
; you use this feature, and the argument will be passed by value instead of by
; reference).
allow_call_time_pass_reference = On
;
; Safe Mode
;
safe_mode = Off
; By default, Safe Mode does a UID compare check when
; opening files. If you want to relax this to a GID compare,
; then turn on safe_mode_gid.
safe_mode_gid = Off
; When safe_mode is on, UID/GID checks are bypassed when
; including files from this directory and its subdirectories.
; (directory must also be in include_path or full path must
; be used when including)
safe_mode_include_dir =
; When safe_mode is on, only executables located in the safe_mode_exec_dir
; will be allowed to be executed via the exec family of functions.
safe_mode_exec_dir =
; Setting certain environment variables may be a potential security breach.
; This directive contains a comma-delimited list of prefixes. In Safe Mode,
; the user may only alter environment variables whose names begin with the
; prefixes supplied here. By default, users will only be able to set
; environment variables that begin with PHP_ (e.g. PHP_FOO=BAR).
;
; Note: If this directive is empty, PHP will let the user modify ANY
; environment variable!
safe_mode_allowed_env_vars = PHP_
; This directive contains a comma-delimited list of environment variables that
; the end user won't be able to change using putenv(). These variables will be
; protected even if safe_mode_allowed_env_vars is set to allow to change them.
safe_mode_protected_env_vars = LD_LIBRARY_PATH
; open_basedir, if set, limits all file operations to the defined directory
; and below. This directive makes most sense if used in a per-directory
; or per-virtualhost web server configuration file. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
;open_basedir =
; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
disable_functions =
; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
disable_classes =
; Colors for Syntax Highlighting mode. Anything that's acceptable in
; <span style="color: ???????"> would work.
;highlight.string = #DD0000
;highlight.comment = #FF9900
;highlight.keyword = #007700
;highlight.bg = #FFFFFF
;highlight.default = #0000BB
;highlight.html = #000000
; If enabled, the request will be allowed to complete even if the user aborts
; the request. Consider enabling it if executing long request, which may end up
; being interrupted by the user or a browser timing out.
; ignore_user_abort = On
;
; Misc
;
; Decides whether PHP may expose the fact that it is installed on the server
; (e.g. by adding its signature to the Web server header). It is no security
; threat in any way, but it makes it possible to determine whether you use PHP
; on your server or not.
expose_php = On
;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;
max_execution_time = 3000 ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
memory_limit = 8M ; Maximum amount of memory a script may consume (8MB)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; error_reporting is a bit-field. Or each number up to get desired error
; reporting level
; E_ALL - All errors and warnings (doesn't include E_STRICT)
; E_ERROR - fatal run-time errors
; E_WARNING - run-time warnings (non-fatal errors)
; E_PARSE - compile-time parse errors
; E_NOTICE - run-time notices (these are warnings which often result
; from a bug in your code, but it's possible that it was
; intentional (e.g., using an uninitialized variable and
; relying on the fact it's automatically initialized to an
; empty string)
; E_STRICT - run-time notices, enable to have PHP suggest changes
; to your code which will ensure the best interoperability
; and forward compatibility of your code
; E_CORE_ERROR - fatal errors that occur ring PHP's initial startup
; E_CORE_WARNING - warnings (non-fatal errors) that occur ring PHP's
; initial startup
; E_COMPILE_ERROR - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR - user-generated error message
; E_USER_WARNING - user-generated warning message
; E_USER_NOTICE - user-generated notice message
;
; Examples:
;
; - Show all errors, except for notices and coding standards warnings
;
;error_reporting = E_ALL & ~E_NOTICE
;
; - Show all errors, except for notices
;
;error_reporting = E_ALL & ~E_NOTICE | E_STRICT
;
; - Show only errors
;
;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
;
; - Show all errors except for notices and coding standards warnings
;
error_reporting = E_ALL & ~E_NOTICE
; Print out errors (as a part of the output). For proction web sites,
; you're strongly encouraged to turn this feature off, and use error logging
; instead (see below). Keeping display_errors enabled on a proction web site
; may reveal security information to end users, such as file paths on your Web
; server, your database schema or other information.
display_errors = On
; Even when display_errors is on, errors that occur ring PHP's startup
; sequence are not displayed. It's strongly recommended to keep
; display_startup_errors off, except for when debugging.
display_startup_errors = Off
; Log errors into a log file (server-specific log, stderr, or error_log (below))
; As stated above, you're strongly advised to use error logging in place of
; error displaying on proction web sites.
log_errors = Off
; Set maximum length of log_errors. In error_log information about the source is
; added. The default is 1024 and 0 allows to not apply any maximum length at all.
log_errors_max_len = 1024
; Do not log repeated messages. Repeated errors must occur in same file on same
; line until ignore_repeated_source is set true.
ignore_repeated_errors = Off
; Ignore source of message when ignoring repeated messages. When this setting
; is On you will not log errors with repeated messages from different files or
; sourcelines.
ignore_repeated_source = Off
; If this parameter is set to Off, then memory leaks will not be shown (on
; stdout or in the log). This has only effect in a debug compile, and if
; error reporting includes E_WARNING in the allowed list
report_memleaks = On
; Store the last error/warning message in $php_errormsg (boolean).
track_errors = Off
; Disable the inclusion of HTML tags in error messages.
; Note: Never use this feature for proction boxes.
;html_errors = Off
; If html_errors is set On PHP proces clickable error messages that direct
; to a page describing the error or function causing the error in detail.
; You can download a of the PHP manual from http://www.php.net/docs.php
; and change docref_root to the base URL of your local including the
; leading '/'. You must also specify the file extension being used including
; the dot.
; Note: Never use this feature for proction boxes.
;docref_root = "/phpmanual/"
;docref_ext = .html
; String to output before an error message.
;error_prepend_string = "<font color=ff0000>"
; String to output after an error message.
;error_append_string = "</font>"
; Log errors to specified file.
;error_log = filename
; Log errors to syslog (Event Log on NT, not valid in Windows 95).
;error_log = syslog
;;;;;;;;;;;;;;;;;
; Data Handling ;
;;;;;;;;;;;;;;;;;
;
; Note - track_vars is ALWAYS enabled as of PHP 4.0.3
; The separator used in PHP generated URLs to separate arguments.
; Default is "&".
;arg_separator.output = "&"
; List of separator(s) used by PHP to parse input URLs into variables.
; Default is "&".
; NOTE: Every character in this directive is considered as separator!
;arg_separator.input = ";&"
; This directive describes the order in which PHP registers GET, POST, Cookie,
; Environment and Built-in variables (G, P, C, E & S respectively, often
; referred to as EGPCS or GPC). Registration is done from left to right, newer
; values override older values.
variables_order = "EGPCS"
; Whether or not to register the EGPCS variables as global variables. You may
; want to turn this off if you don't want to clutter your scripts' global scope
; with user data. This makes most sense when coupled with track_vars - in which
; case you can access all of the GPC variables through the $HTTP_*_VARS[],
; variables.
;
; You should do your best to write your scripts so that they do not require
; register_globals to be on; Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
register_globals = On
; Whether or not to register the old-style input arrays, HTTP_GET_VARS
; and friends. If you're not using them, it's recommended to turn them off,
; for performance reasons.
register_long_arrays = On
; This directive tells PHP whether to declare the argv&argc variables (that
; would contain the GET information). If you don't use these variables, you
; should turn it off for increased performance.
register_argc_argv = On
; When enabled, the SERVER and ENV variables are created when they're first
; used (Just In Time) instead of when the script starts. If these variables
; are not used within a script, having this directive on will result in a
; performance gain. The PHP directives register_globals, register_long_arrays,
; and register_argc_argv must be disabled for this directive to have any affect.
auto_globals_jit = On
; Maximum size of POST data that PHP will accept.
post_max_size = 8M
; Magic quotes
;
; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = On
; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
magic_quotes_runtime = Off
; Use Sybase-style magic quotes (escape ' with '' instead of \').
magic_quotes_sybase = Off
; Automatically add files before or after any PHP document.
auto_prepend_file =
auto_append_file =
; As of 4.0b4, PHP always outputs a character encoding by default in
; the Content-type: header. To disable sending of the charset, simply
; set it to be empty.
;
; PHP's built-in default is text/html
default_mimetype = "text/html"
;default_charset = "iso-8859-1"
; Always populate the $HTTP_RAW_POST_DATA variable.
;always_populate_raw_post_data = On
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
include_path = ".;D:\apptools\php5\PEAR"
; The root of the PHP pages, used only if nonempty.
; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
; if you are running php as a CGI under any web server (other than IIS)
; see documentation for security issues. The alternate is to use the
; cgi.force_redirect configuration below
doc_root =
; The directory under which PHP opens the script using /~username used only
; if nonempty.
user_dir =
; Directory in which the loadable extensions (moles) reside.
extension_dir = "D:/apptools/php5/ext"
; Whether or not to enable the dl() function. The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
enable_dl = On
7. 编程都有哪些语言
目前热门的语言有:C、C++、JAVA、VB、VC、FoxPro、Delphi、SQL、PHP、ASP、JSP等等。
专门有机构为编程语言进行排名,如下图:
8. 编程语言一共有多少种
一般编程语言分成机器语言、汇编语言和高级语言。机器语言就是二进制代码,可读性低,所以一般是用其他语言先编写代码,然后编译为机器代码,方可运行。
编程语言有好几千种,这里是一些常见的:
C,C++,C#,Java,JavaScript,python,Pascal,Delphi,PHP,SQL,ASP,Matlab,HTML,Bash,Batch,Ruby,Basic,Visual Basic等等
9. Sublime Text,php代码格式化插件codeformatter 设置PHP代码格式时报错 怎么处理
{
"codeformatter_debug": false,
"codeformatter_php_options":
{
"syntaxes": "php", // Syntax names which must process PHP formatter
"php_path": "这里改成你php的路径", // Path for PHP executable, e.g. "/usr/lib/php" or "C:/Program Files/PHP/php.exe". If empty, uses command "php" from system environments
"format_on_save": false, // Format on save. Either a boolean (true/false) or a string regexp tested on filename. Example : "^((?!.min.|vendor).)*$"
"php55_compat": false, // PHP 5.5 compatible mode
"psr1": false, // Activate PSR1 style
"psr1_naming": false, // Activate PSR1 style - Section 3 and 4.3 - Class and method names case
"psr2": true, // Activate PSR2 style
"indent_with_space": 4, // Use spaces instead of tabs for indentation
"enable_auto_align": true, // Enable auto align of = and =>
"visibility_order": true, // Fixes visibility order for method in classes - PSR-2 4.2
"smart_linebreak_after_curly": true, // Convert multistatement blocks into multiline blocks
// Enable specific transformations. Example: ["ConvertOpenTagWithEcho", "PrettyPrintDocBlocks"]
// You can list all available transformations from command palette: CodeFormatter: Show PHP Transformations
"passes": [],
// Disable specific transformations
"excludes": []
},
"codeformatter_js_options":
{
"syntaxes": "javascript,json", // Syntax names which must process JS formatter
"format_on_save": false, // Format on save. Either a boolean (true/false) or a string regexp tested on filename. Example : "^((?!.min.|vendor).)*$"
"indent_size": 4, // indentation size
"indent_char": " ", // Indent character
"indent_with_tabs": false, // Indent with one tab (overrides indent_size and indent_char options)
"eol": "\n", // EOL symbol
"preserve_newlines": false, // whether existing line breaks should be preserved,
"max_preserve_newlines": 10, // maximum number of line breaks to be preserved in one chunk
"space_in_paren": false, // Add padding spaces within paren, ie. f( a, b )
"space_in_empty_paren": false, // Add padding spaces within paren if parent empty, ie. f( )
"e4x": false, // Pass E4X xml literals through untouched
"jslint_happy": false, // if true, then jslint-stricter mode is enforced. Example function () vs function()
"space_after_anon_function": false, // Space after anonimouse functions
"brace_style": "collapse", // "collapse" | "expand" | "end-expand". put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line.
"keep_array_indentation": false, // keep array indentation.
"keep_function_indentation": false, // keep function indentation.
"eval_code": false, // eval code
"unescape_strings": false, // Decode printable characters encoded in xNN notation
"wrap_line_length": 0, // Wrap lines at next opportunity after N characters
"unindent_chained_methods": false, // Unindent chained method calls
"break_chained_methods": false, // Break chained method calls across subsequent lines
"end_with_newline": false, // Add new line at end of file
"comma_first": false, // Add comma first
"operator_position": "before-newline" // Operator position: before-newline, after-newline, preserve-newline
},
"codeformatter_css_options":
{
"syntaxes": "css,less", // Syntax names which must process CSS formatter
"format_on_save": false, // Format on save. Either a boolean (true/false) or a string regexp tested on filename. Example : "^((?!.min.|vendor).)*$"
"indent_size": 4, // Indentation size
"indent_char": " ", // Indentation character
"indent_with_tabs": false, // Indent with one tab (overrides indent_size and indent_char options)
"selector_separator_newline": false, // Add new lines after selector separators
"end_with_newline": false, // Add new line of end in file
"newline_between_rules": false, // Add new line between rules
"space_around_combinator": false, // Space around combinator
"eol": "\n" // EOL symbol
},
"codeformatter_scss_options":
{
"syntaxes": "scss,sass", // Indentation size
"format_on_save": false, // Format on save. Either a boolean (true/false) or a string regexp tested on filename. Example : "^((?!.min.|vendor).)*$"
"indent_size": 4, // Indentation size
"indent_char": " ", // Indentation character
"indent_with_tabs": false, // Indent with one tab (overrides indent_size and indent_char options)
"selector_separator_newline": false, // Add new lines after selector separators
"end_with_newline": false, // Add new line of end in file
"newline_between_rules": false, // Add new line between rules
"space_around_combinator": false, // Space around combinator
"eol": "\n" // EOL symbol
},
"codeformatter_html_options":
{
"syntaxes": "html,blade,asp,xml", // Syntax names which must process HTML formatter
"format_on_save": false, // Format on save. Either a boolean (true/false) or a string regexp tested on filename. Example : "^((?!.min.|vendor).)*$"
"formatter_version": "bs4", // Which formatter to use. Current options are "bs4" and "regexp". If an error occurs while loading the bs4 formatter, the regexp formatter will automatically be used
"indent_size": 4, // indentation size
"indent_char": " ", // Indentation character
"indent_with_tabs": false, // Indent with one tab (overrides indent_size and indent_char options)
"exception_on_tag_mismatch": false, // If the last closing tag is not at the same indentation level as the first opening tag, there's probably a tag mismatch in the file
"expand_javascript": false, // (Under construction) Expand JavaScript inside of <script> tags (also affects CSS purely by coincidence)
"expand_tags": false, // Expand tag attributes onto new lines
"minimum_attribute_count": 2, // Minimum number of attributes needed before tag attributes are expanded to new lines
"first_attribute_on_new_line": false, // Put all attributes on separate lines from the tag (only uses 1 indentation unit as opposed to lining all attributes up with the first)
"rece_empty_tags": false, // Put closing tags on same line as opening tag if there is no content between them
"rece_whole_word_tags": false, // Put closing tags on same line as opening tag if there is whole word between them
"custom_singletons": "" // Custom singleton tags for various template languages outside of the HTML5 spec
},
"codeformatter_python_options":
{
"syntaxes": "python", // Syntax names which must process Python formatter
"format_on_save": false, // Format on save. Either a boolean (true/false) or a string regexp tested on filename. Example : "^((?!.min.|vendor).)*$"
"indent_size": 1, // indentation size
"indent_with_tabs": true, // Indent with tabs or spaces
"max_char": 80, // Width of output lines in characters.
"assignment": " = ", // This is how the assignment operator is to appear.
"function_param_assignment": "=", // This is how function-parameter assignment should appear.
"function_param_sep": ", ", // This is how function parameters are separated.
"list_sep": ", ", // This is how list items are separated.
"subscript_sep": "=", // This is how subscripts are separated.
"dict_colon": ": ", // This separates dictionary keys from values.
"slice_colon": ":", // this separates the start:end indices of slices.
"comment_prefix": "# ", // This is the sentinel that marks the beginning of a commentary string.
"shebang": "#!/usr/bin/env python", // Hashbang, a line-one comment naming the Python interpreter to Unix shells.
"boilerplate": "", // Standard code block (if any). This is inserted after the mole doc string on output.
"blank_line": "", // This is how a blank line is to appear (up to the newline character).
"keep_blank_lines": true, // If true, preserve one blank where blank(s) are encountered.
"add_blank_lines_around_comments": true, // If true, set off comment blocks with blanks.
"add_blank_line_after_doc_string": true, // If true, add blank line after doc strings.
"max_seps_func_def": 3, // Split lines containing longer function definitions.
"max_seps_func_ref": 5, // Split lines containing longer function calls.
"max_seps_series": 5, // Split lines containing longer lists or tuples.
"max_seps_dict": 3, // Split lines containing longer dictionary definitions.
"max_lines_before_split_lit": 2, // Split string literals containing more newline characters.
"left_margin": "", // This is how the left margin is to appear.
"normalize_doc_strings": false, // If true, normalize white space in doc strings.
"leftjust_doc_strings": false, // If true, left justify doc strings.
"wrap_doc_strings": false, // If true, wrap doc strings to max_char.
"leftjust_comments": false, // If true, left justify comments.
"wrap_comments": false, // If true, wrap comments to max_char.
"double_quoted_strings": false, // If true, use quotes instead of apostrophes for string literals.
"single_quoted_strings": false, // If true, use apostrophes instead of quotes for string literals.
"can_split_strings": false, // If true, longer strings are split at the max_char.
"doc_tab_replacement": "....", // This literal replaces tab characters in doc strings and comments.
// Optionally preserve unassigned constants so that code to be tidied
// may contain blocks of commented-out lines that have been no-op'ed
// with leading and trailing triple quotes. Python scripts may declare
// constants without assigning them to a variables, but CodeFormatter
// considers this wasteful and normally elides them.
"keep_unassigned_constants": false,
// Optionally omit parentheses around tuples, which are superfluous
// after all. Normal CodeFormatter behavior will be still to include them
// as a sort of tuple display analogous to list displays, dict
// displays, and yet-to-come set displays.
"parenthesize_tuple_display": true,
// When CodeFormatter splits longer lines because max_seps
// are exceeded, the statement normally is closed before the margin is
// restored. The closing bracket, brace, or parenthesis is placed at the
// current indent level. This looks ugly to "C" programmers. When
// java_style_list_dedent is True, the closing bracket, brace, or
// parenthesis is brought back left to the indent level of the enclosing
// statement.
"java_style_list_dedent": false
},
"codeformatter_vbscript_options":
{
"syntaxes": "vbscript", // Syntax names which must process VBScript formatter
"format_on_save": false, // Format on save. Either a boolean (true/false) or a string regexp tested on filename. Example : "^((?!.min.|vendor).)*$"
"indent_size": 1, // indentation size
"indent_char": "\t", // Indentation character
"indent_with_tabs": true, // Indent with one tab (overrides indent_size and indent_char options)
"preserve_newlines": true, // Preserve existing line-breaks
"max_preserve_newlines": 10, // Maximum number of line-breaks to be preserved in one chunk
"opening_tags": "^(Function .*|Sub .*|If .* Then|For .*|Do While .*|Select Case.*)", // List of keywords which open a new block
"middle_tags": "^(Else|ElseIf .* Then|Case .*)$", // List of keywords which divide a block, but neither open or close the block
"closing_tags": "(End Function|End Sub|End If|Next|Loop|End Select)$" // List of keywords which close an open block
},
"codeformatter_coldfusion_options":
{
"syntaxes": "coldfusion,cfm,cfml", // Syntax names which must process Coldfusion Markup Language formatter
"format_on_save": false, // Format on save. Either a boolean (true/false) or a string regexp tested on filename. Example : "^((?!.min.|vendor).)*$"
"indent_size": 2, // indentation size
"indent_char": " ", // Indentation character
"indent_with_tabs": false, // Indent with one tab (overrides indent_size and indent_char options)
"exception_on_tag_mismatch": false, // If the last closing tag is not at the same indentation level as the first opening tag, there's probably a tag mismatch in the file
"expand_javascript": false, // (Under construction) Expand JavaScript inside of <script> tags (also affects CSS purely by coincidence)
"expand_tags": false, // Expand tag attributes onto new lines
"minimum_attribute_count": 2, // Minimum number of attributes needed before tag attributes are expanded to new lines
"first_attribute_on_new_line": false, // Put all attributes on separate lines from the tag (only uses 1 indentation unit as opposed to lining all attributes up with the first)
"rece_empty_tags": false, // Put closing tags on same line as opening tag if there is no content between them
"rece_whole_word_tags": false, // Put closing tags on same line as opening tag if there is whole word between them
"custom_singletons": "" // Custom singleton tags for various template languages outside of the HTML5 spec
}
}
10. PHP,JSP,ASP是什么干什么用的之间有什么关系吗
PHP,Hypertext Preprocessor,最初在95年问世(那时以前叫Personal Home Page)。PHP最初是制作动态网页的服务器端脚本语言,但现在PHP已经可以作为command line运行有GUI的standalone的程序。现在是PHP Group在开发和管理PHP的规则,功能等。但PHP大都用在dynamic webpage scripting上,好象没听过谁用它开发desktop application。
PHP使用率是制作动态网页的几种语言(JSP,ASP,ASP.NET, ColdFusion, Ruby, SHTML)中最高的。因为PHP在95年已经问世至今,以有相当数量的开发者。我们熟知的国际权威网络全书Wikipedia有90%用PHP写的,而且国外流行多年的“校内网”FaceBook 也全部用PHP写的,同时Yahoo, Sony官方,Pepsi百事官方这些网站都是用PHP的。根据维基网络(Wikipedia)的说法,PHP被超过20,000,000的网站所用,被超过1,000,000的网页服务器所用。目前到2008五月,PHP最新版本为5.2.6。
PHP不仅使用率高,而且能兼容各类平台。它可以在大多数网页服务器上运行(如:MS IIS,Apache),大多数操作系统上运行(如:Windows, UNIX, Linux)。而且PHP支持很大多数牌子的数据库:MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Gerneric ODBC等。
结构方面,虽比JSP,ASP.NET差点,PHP也有很多Framework可用。微软的ASP.NET结构是出名的,JSP的MVC结构也很厉害,所以开发大网站ASP.NET,JSP都很快。而PHP Group也为此付出很大努力,来开发自己特有的结构适应不同类型的大网站的需求。常见的PHP的Framework有:CakePHP, PRADO, Symfony, Zend等。
另外LAMP结构,是PHP最常用的开发模式,即是配合Linux, Apache, MySQL, PHP,合称LAMP。个人认为这种方式才是ASP.NET,PHP,JSP中最简单的。
3. 说说JSP。(本人工作中用的最多的就是JSP)
JSP, JavaServer Pages 是Java技术的一部分,可以说是Java Platform Enterprise Edition的一部分(JAVA主要3个大技术,Java SE, Java EE, Java ME)。软件开发者可以用JSP来动态生成HTML,XML或者其他的文档。然后把文档response给网页用户。这项技术,可以用Java里的所有定义过的library来支持它的功能,所以JSP的API和普通Java EE的API一样。
JSP里还有很多有功能的XML tag(如:<jsp:include>,<jsp:useBean)。这些都是JAVA内置功能,不需要导入新的外置 library。这些XML tag,可以在很多Web Server里使用(如:Apache, Apache TomCat, WebLogic等)。
JSP在编译后就完全和Servlet一样了。JSP页面在第一次被用户访问的时候,首先被JAVA 编译器,编译成Java Servlet Class。然后编译后Servlet Class,在以后被用户访问时,直接在JVM里运行,由JSP Web Container来输出HTML给用户。JSP这种“首次访问-预编译”的运行方式比传统PHP(PHP 4和PHP以前版本),过时的ASP(所有版本的ASP),要快很多。(网络一位网友作过一个1万次For Loop,循环的测试,结果发现JSP比传统PHP,ASP快尽10被的速度就完成运算)。预编译的运行方式后来被PHP5效仿,ASP.NET也是预编译的。当然JSP还有一个好处,就是可以直接用纯Java (无HTML),来写一个Servlet,直接在JVM运行后,由JSP Web Container输出HTML给用户。只是Servlet有的时候写一些presentation tier的东西很麻烦,因为它不能融合XML和输出逻辑在一起。所以一般Servlet用于纯Java的business logic逻辑。
JSP的tag还可以由用户自己来创造和使用,这个和ASP.NET里的user-defined controls差不多。
MVC, Model-View-Controller,是JSP的普遍开发架构,用来把JSP技术中的presentation, business logic, data storage三层清楚的分开。这样使开发过程更佳清楚明了,便于开发,维护。常用的MVB架构有:Barracuda, Apache Struts和Spring。JSF,JavaServer Faces是一个由SUN官方开发的Framework,是模仿ASP.NET的event-driven开发模式,和ASP.NET非常相似。但SUN 并没有让JSF替代JSP,相反JSF的开发者少之又少,但是据说现在JSF或JSP配合RAD(AJAX)开发很流行(校内网就是这样,而且结合Struts)。
4. ASP(Active Server Pages), ASP.NET 两个分别是 动态网页开发语言,动态网页开发语言和结构
(1) 关于ASP的淘汰
ASP, Active Server Pages已经过时了, 但因为其出现的早,96年就有了,所以现在有些中小网站还用(但,使用最多最广的是PHP,最初于95年现世。ASP是微软第一代动态网页开发语言,只能在Windows系统 + MS IIS服务器平台下运行。
Wikipedia, Facebook, 网络等都用PHP,PHP学习的简单度和ASP差不多;JSP稍微难点,JSP用的一般都是银行,购物等安全性较高的网站,Google也用JSP)。但随着开发者的各种需求,ASP以后可以被ASP.NET取代,因为微软停止对其的一切技术维护与功能更新。ASP.NET是革新版本的ASP(注意是“革新版本”,而非“改进版本”),或者说是完全新一代的Dynamic Web Scripting。
ASP代表着传统的dynamic web scripting,与ASP.NET没什么关系,学了确实也没用。因为ASP不象CGI(Common Gateway Interface),CGI是动态网站制作的始祖,所有ASP,JSP,PHP什么的都根据CGI演化而来,而且ASP,PHP,JSP都包含了些 CGI的东西;而ASP却没有被衍生出任何新技术,ASP.NET也不算基于ASP,只能说ASP.NET开发理念,library,功能完全是基于.NET的其它组件。
其实PHP,JSP,ASP明白其中一种,其它的都很容易学会了。如果非要学学传统的dynamic web scripting,那就学学PHP吧,不比ASP难,但比ASP功能多,稳定性好,PHP5运行速度也比ASP快很多(JSP稍难因为要学点 Java)。学了PHP或JSP什么的,对学ASP.NET有好处,而且还可以直接用PHP,JSP进行开发。去google差差英文资源,有评价PHP 最好的,有评价JSP最好的,还从没有听谁说过ASP最好。
ASP.NET毕竟在.NET中,所以ASP.NET还是有相当地位的。
(2). 关于ASP.NET的优势
ASP.NET是微软.NET Framework的一部分。伴随.NET 1.0在2002的问世,ASP.NET也出现在动态网页开发语言的家族中(与PHP,JSP,ColdFusion, Ruby, SHTML等并行了)。
功能上,ASP.NET比ASP有更强大的library, 更好的稳定性。 ASP.NET可以使用.NET Framework中所有组件(也就是说.NET能实现的,ASP.NET一样能实现),功能上显然强大于传统功能单调的ASP。最强的技术支持Web Service, 而且有.NET的所有library做后盾。而且ASP.NET 在.NET 3.5中还有微软专门为AJAX开发的功能--ASP.NET AJAX。
结构上,传统的ASP把所有代码混为一团,简单的用<%%>把HTML和VBScript(或JScript)分开,实现动态输出 HTML。因为ASP.NET模仿JSP的MVC网页结构,微软为ASP.NET开发了自己的Code-Behind结构,将 presentation(文件拓展名:.aspx)和business logic(文件拓展名:.cs或.vb等)分离。同时Code-Behind模式也实现了让ASP.NET开发者用.NET中最普通Winform的开发模式来开发网站,方便非网页开发者制作动态网站。所以ASP.NET更容易维护,比ASP更适合于Enterprise Level 的大网站开发。
由于ASP.NET比JSP,PHP等更接近于.NET Winform的开发。如Tree View, Datagrid View(即高级Table)等高级UI,都可以直接用ASP.NET中的Web Control来实现,这比传统的使用JavaScript + XTHML + CSS的DHTML开发方式简单不少,也更好维护。同时ASP.NET开发这可以定义自己的User Control,制作自己特别的一种UI(如网站LOGO,版权等部分),而且此User Control可以被存为.ascx文件,方便让每一页(.aspx)来使用。
运行速度上,ASP.NET模仿了JSP的预编译机制(Pre-Compile)。使编译好的代码(MSIL语言)在网页服务器上运行。这样比传统的ASP,传统PHP(PHP4以前版本)更快,因为传统的ASP是直接运行开发者写的Script,相当于每运行一次,就得编译一次那么慢。 ASP.NET可以用VB, C#, J#等所有.NET Framework的语言开发.(但其实每种语言做的东西都一样... 就象山东话, 东北话, 写出来都是中文:)
不过ASP.NET对出学者可能有点难. 因为它其实在模拟desktop application development,即Winforms开发的模式, 不象传统的JSP,PHP, ASP这样容易明白。传统的Dynamic Server Scripting, 象PHP 5, 这是现在最简单的, 最有效的了。( 那个JSP也不难. 如果有钱还可以考虑下Adobe ColdFusion。)
ASP.NET的新潮的Dynamic Server Scripting, 在其带动下SUN也推出自己的JavaServer Faces (其实是拓展JSP,但JSF无法取代JSP), 和ASP.NET很象, 也有很多Web Control(JTable, JTree),同时JSF也曾强了对WEB SERVCIE的支持, 也很适合ENTERPRISE LEVEL 的网站。
(3). ASP与ASP.NET的优劣总结:
-- ASP已经被微软停止更新;ASP.NET却在.NET(1.0, 2.0, 3.0, 3.5)中突飞猛进;
-- ASP在96年出现,并没有引领一个潮流,PHP,ColdFusion都出现于95年,引领了整个潮流;ASP.NET引领新的动态网站开发潮流,SUN的JSF(JavaServer Faces)就是与ASP.NET极其相似;
-- ASP大多被用在是中小网站;PHP被Wikipedia, Facebook, 网络所用,JSP被GOOGLE所用;
-- ASP不支持Web Service; ASP.NET支持Web Service。要是了解.NET中的Web Service在大组织系统中的重要性,就能立杆见影的看出差距
-- ASP开发AJAX比较麻烦;而ASP.NET专门用AJAX控件,更方便。要是了解Web 2.0,那么AJAX是什么地位,就不用我说了吧。
-- ASP.NET模仿JSP,是pre-compile的;ASP不compile,直接运行Script的速度显然没有compile之后的快。
-- ASP.NET的唯一缺点,就是开发用的IDE--Visual Studio Professional比较贵(express版免费的功能太少);ASP的唯一优点是,其
学起来最简单,跟PHP一样简单,比JSP简单,更比ASP.NET简单几倍。