[root@LAMP php-5.3.27]# ls php
php5.spec php.ini-development
php5.spec.in php.ini-production
php.gif
[root@LAMP php-5.3.27]# diff php.ini-production php.ini-development 对比对内开发配置文件和对外应用配置文件
521c521
< error_reporting = E_ALL & ~E_DEPRECATED
---
> error_reporting = E_ALL | E_STRICT
538c538
< display_errors = Off
---
> display_errors = On
549c549
< display_startup_errors = Off
---
> display_startup_errors = On
593c593
< track_errors = Off
---
> track_errors = On
611c611
< html_errors = Off
---
> html_errors = On
751c751
< ; scheduled removed in PHP 5.4.
---
> ; removed in PHP 5.4.
845c845
< ;cgi.redirect_status_env =
---
> ;cgi.redirect_status_env =
1318c1318
< mysqlnd.collect_memory_statistics = Off
---
> mysqlnd.collect_memory_statistics = On
1587c1587
< session.bug_compat_42 = Off
---
> session.bug_compat_42 = On
1596c1596
< session.bug_compat_warn = Off
---
> session.bug_compat_warn = On
[root@LAMP php-5.3.27]# cp php
php5.spec php.ini-development
php5.spec.in php.ini-production
php.gif
[root@LAMP php-5.3.27]# cp php.ini-production /application/php/lib/php.ini
[root@LAMP php-5.3.27]#
小结:正式配置文件一般关闭显示LOG,不输出LOG。
六、开启虚拟机功能并修改用户及用户组:useradd -M -s /sbin/nologin wapp
cd /application/apache/conf
vi httpd.conf
找到
User daemon 修改为wapp
Group daemon 修改为wapp
找到 # Include conf/extra/httpd-vhosts.conf 开启虚拟机
取消前面的#号注释,保存退出。
七、整合php和apache: vi httpd.conf
定位至AddType application/x-gzip .gz .tgz添加如下二行:
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
定位至DirectoryIndex index.html
修改为:
DirectoryIndex index.php index.html
然后重新启动apache,或让其重新载入配置文件即可测试php是否已经可以正常使用。
八、定义虚拟机: cd /application/apache/conf/extra
vi httpd-vhosts.conf
在文件最后面加入几个基于域名访问的虚拟机实例如下:
<VirtualHost *:80>
ServerAdmin kk@linuxidc.com
DocumentRoot "/data/cms"
ServerName
ServerAlias linuxidc.org
ErrorLog "logs/www.linuxidc.org-error_log"
CustomLog "logs/www.linuxidc.org-access_log" common
</VirtualHost>
<VirtualHost *:80>