在新设置的digitalOcean云服务器(CentOS的),我已经安装了PHP和Apache。 Web服务器正在运行的罚款:
In a newly setup digitalOcean cloud server (CentOS), I have installed php and Apache. The webserver is running fine:
[root@a2m5cent01 httpd]# service httpd status httpd (pid 11232) is running... [root@a2m5cent01 httpd]# php --version | head -1 PHP 5.3.3 (cli) (built: Dec 11 2013 03:29:57)不过,浏览器显示,如果我尝试访问任何PHP页面空白页(白页)。
But browser is showing blank pages (white page) if I try to visit any php page.
这是我迄今所做的解决:
Here is what I have done so far to troubleshoot:
那么为什么它总是显示一个空白/白页在浏览器?还有什么我缺少什么?
Then why is it always shows a blank/white page over the browser? What else am I missing?
修改根据建议,由@Nathan,
EDIT Based on suggestions from @Nathan,
Apache是的不可以即使日志记录PHP文件的访问请求。任何想法,为什么会发生呢?
Apache is not even logging any access request for PHP files. Any idea why would that happen?
推荐答案我觉得你的PHP的安装与Apache故障。这就是为什么你不能看到任何PHP页面在你的网络服务器。清洁删除所有现有的应用程序,像httpd,PHP,PHP-FPM,PHP-CLI等,并尝试清洁6.在安装按照此顺序
I think your php installation with apache is faulty. Thats why you can not see any php page in your webserver. Clean remove all the existing apps, like httpd,php,php-fpm,php-cli etc. and try to clean isntall in this order
yum install httpd -y yum install php php-common php-cli php-gd php-curl php-fpm -y然后确保你重新启动httpd的YOUT服务器。
then make sure you restart yout httpd server.
service httpd restart安装的mod_fastcgi:
Install mod_fastcgi:
yum install mod_fastcgi启动服务:
service php-fpm start重启Apache:
Restart Apache:
service httpd restart5。阿帕奇与PHP-FPM配置
打开fastcgi.conf文件:
Open the fastcgi.conf file:
nano /etc/httpd/conf.d/fastcgi.conf这添加到该文件的末尾:
Add this to the end of the file:
<IfModule mod_fastcgi.c> DirectoryIndex index.html index.shtml index.cgi index.php AddHandler php5-fcgi .php Action php5-fcgi /php5-fcgi Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization </IfModule>在FastCgiWrapper后搜索,并确保它被设置为关闭,然后保存文件。
After that search after "FastCgiWrapper" and make sure it's set to "off" then save the file.
在/ usr / lib目录/ cgi-bin目录/目录必须存在的,所以我们创建它:
The /usr/lib/cgi-bin/ directory must exist, so we create it:
mkdir /usr/lib/cgi-bin/如果已安装并启用mod_php的,我们需要禁用的/etc/httpd/conf.d/php.conf这么打开配置:
If mod_php is installed and enabled, we need to disable it so open the configuration at /etc/httpd/conf.d/php.conf:
nano /etc/httpd/conf.d/php.conf注释掉的AddHandler和将AddType行,这样它看起来像在这里:
Comment out the AddHandler and AddType lines so it looks like here:
# # PHP is an HTML-embedded scripting language which attempts to make it # easy for developers to write dynamically generated webpages. # <IfModule prefork.c> LoadModule php5_module modules/libphp5.so </IfModule> <IfModule worker.c> LoadModule php5_module modules/libphp5-zts.so </IfModule> # # Cause the PHP interpreter to handle files with a .php extension. # #AddHandler php5-script .php #AddType text/html .php # # Add index.php to the list of files that will be served as directory # indexes. # DirectoryIndex index.php # # Uncomment the following line to allow PHP to pretty-print .phps # files as PHP source code: # #AddType application/x-httpd-php-source .phps保存文件并重新启动Apache:
Save the file and restart Apache:
service httpd restart更多推荐
获得空白的PHP页面上的Apache
发布评论