1、PHP配置文件
文件所在目录 /etc/php5/apache2/php.ini
Php.ini 中“资源限制” Resource Limits需要调整的可能性比较大。
;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;
; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 30 //单个PHP文件的最大运行时间,单位是秒
; idea to limit this time on productions servers in order to eliminate unexpect$
; long running scripts.
; Note: This directive is hardcoded to -1 for the CLI SAPI
; Default Value: -1 (Unlimited)
; Development Value: 60 (60 seconds)
; Production Value: 60 (60 seconds)
; http://php.net/max-input-time
max_input_time = 60 //单个PHP文件接收数据花费的最大时间
; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 128M //单个PHP文件可以占用的最大内存
2、 测试PHP是否已经运行
进入网站所在目录,建立info.php文件,输出php信息。
3、 PHP排错
当phpinfo没有正常显示时,可能出现以下问题:
第一、 没有重启APACE,重新启动下
第二、 查看APACHE是否启用了PHP模块,启用并重新启动APACHE
Sudo a2enmod php5
Sudo apache2ct1 restart
第三、如果 sudo a2enmod php5命令返回错误,则需要删除libapache2-mod-php5软件包,并重新安装