0

我编写了一个网站,无需详细了解它,但它可以工作并且不需要任何数据库或类似的东西。但是在我的新 Ubuntu 10.04.4 LTS 服务器上,所有 PHP 页面都显示为空白。我已经使用以下命令安装了 Apache2、PHP5 和一些我不知道它的用途:

sudo apt-get install apache2
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5
sudo /etc/init.d/apache2 restart

我试图在没有运气的情况下卸载并重新安装所有这些组件。PHP 页面都没有出现在我的浏览器中,它们显示为空白并带有空白源,而我所有的纯 .html 页面都可以正常工作。

有什么办法让它工作,我很乐意发布更多信息,但我不知道我应该从哪里得到。

错误日志:

PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/mcrypt.ini on line 1 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/curl.so' - /usr/lib/php5/20090626/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/gd.so' - /usr/lib/php5/20090626/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/mcrypt.so' - /usr/lib/php5/20090626/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/mysql.so' - /usr/lib/php5/20090626/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/mysqli.so' - /usr/lib/php5/20090626/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/pdo_mysql.so' - /usr/lib/php5/20090626/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
[Mon Jul 23 00:36:05 2012] [notice] Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.15 with Suhosin-Patch configured -- resuming normal operations
[Mon Jul 23 00:36:16 2012] [error] [client 217.227.25.35] PHP Parse error:  syntax error, unexpected ')' in /var/www/vtest5532/Header.php on line 19
[Mon Jul 23 00:36:17 2012] [error] [client 217.227.25.35] PHP Parse error:  syntax error, unexpected ')' in /var/www/vtest5532/Header.php on line 19
[Mon Jul 23 00:38:09 2012] [notice] caught SIGTERM, shutting down
PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/mcrypt.ini on line 1 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/curl.so' - /usr/lib/php5/20090626/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/gd.so' - /usr/lib/php5/20090626/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/mcrypt.so' - /usr/lib/php5/20090626/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/mysql.so' - /usr/lib/php5/20090626/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/mysqli.so' - /usr/lib/php5/20090626/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/pdo_mysql.so' - /usr/lib/php5/20090626/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
[Mon Jul 23 00:38:10 2012] [notice] Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.15 with Suhosin-Patch configured -- resuming normal operations
[Mon Jul 23 00:38:59 2012] [error] [client 180.76.5.62] File does not exist: /var/www/Forum
[Mon Jul 23 01:10:36 2012] [error] [client 66.249.68.165] File does not exist: /var/www/Forum
[Mon Jul 23 01:10:36 2012] [error] [client 66.249.68.165] File does not exist: /var/www/Forum
4

1 回答 1

0

PHP 默认配置为不显示错误。如果您检查 Apache 错误日志,/var/log/apache2/error.log您应该会看到问题的原因。如果这是一台开发机器,您还应该将php.ini文件更改为对开发人员更友好的设置(error_reporting最多显示错误)。如果它是生产服务器,则保留 php.ini 原样。

于 2012-07-22T23:07:04.090 回答