本文介绍了与Apache在CentOS上安装PHP 5.3的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题是, PHP -v 显示,PHP 5.3安装,我已经跟Apache HTML文件工作正常,但是PHP文件只是显示的页面的源代码,我意识到这可能是阿帕奇的配置错误,但我已经想尽指南,指南和建议,我能找到的,并得到了什么,我是相当新的CentOS的,所以帮助将是很大的AP preciated。

The problem is, php -v shows that PHP 5.3 is installed, and I have apache working properly with HTML files, however PHP files just displays the source of the page, and i realise this is probably a misconfiguration of apache, but I have tried every guide, tutorial and suggestion i could find, and got nothing, and I am fairly new to centos, so help would be greatly appreciated.

推荐答案

的.php 不应该显示。 ..这意味着安装没有正确完成.. insted的试图修补这深信最终将一个长长的清单,我认为你应该只是重新安装误差

.php should never show source ... that mean the installation was not done properly .. insted trying to patch the error which am sure would eventually be a long list i think you should just re install

更新百胜

yum update

安装优先级

yum install yum-priorities

删除当前的PHP

Remove Current PHP

yum remove php php-*

删除当前的httpd

Remove Current httpd

yum remove httpd

安装Apache

Install Apache

yum install httpd

安装PHP

yum install php53u-pear php53u php53u-cli php53u-common php53u-devel php53u-gd php53u-mbstring php53u-mcrypt php53u-mysql php53u-pdo php53u-soap php53u-xml php53u-xmlrpc php53u-bcmath php53u-pecl-apc php53u-pecl-memcache php53u-snmp

修复APC

yum remove php53u-pecl-apc
yum update php53u-pecl-apc --enablerepo=ius-testing

编辑的php.ini

Edit PHP.ini

 display_errors = On

重启Apache

Restart Apache

 service httpd restart

这篇关于与Apache在CentOS上安装PHP 5.3的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-05 08:12