PHP yum 更新后 CentOS 6 无法运行
PHP not working CentOS 6 after yum update
我遇到了一些问题 运行 yum update
并执行了以下步骤使其工作:
sudo yum --enablerepo=remi,remi-php55 -y remove memcached
- 这只是删除了 memcached,其中一个包给出了错误
sudo yum --enablerepo=remi,remi-php55 -y remove php-pear
- 这比我预料的要多..
Running Transaction Erasing : phpMyAdmin-4.0.4-1.el6.remi.noarch
1/28 waarschuwing: /etc/httpd/conf.d/phpMyAdmin.conf saved as
/etc/httpd/conf.d/phpMyAdmin.conf.rpmsave Erasing :
php-pecl-memcached-2.1.0-6.el6.remi.5.x86_64
2/28 Erasing :
php-pecl-igbinary-1.1.2-0.5.git3b8ab7e.el6.remi.1.x86_64
3/28 Erasing : php-php-gettext-1.0.11-4.el6.remi.noarch
4/28 Erasing : php-pecl-mongo-1.4.1-1.el6.remi.1.x86_64
5/28 Erasing :
php-pecl-sqlite-2.0.0-0.3.svn313074.el6.remi.5.x86_64
6/28 Erasing : php-pecl-memcache-3.0.8-1.el6.remi.1.x86_64
7/28 Erasing :
php-pecl-apc-3.1.15-0.3.svn329913.el6.remi.1.x86_64
8/28 Erasing : php-5.5.0-1.el6.remi.x86_64
9/28 Erasing : php-gmp-5.5.0-1.el6.remi.x86_64
10/28 Erasing : php-mysqlnd-5.5.0-1.el6.remi.x86_64
11/28 Erasing : php-recode-5.5.0-1.el6.remi.x86_64
12/28 Erasing : php-tcpdf-dejavu-sans-fonts-6.0.049-1.el6.noarch
13/28 Erasing : php-tcpdf-6.0.049-1.el6.noarch
14/28 Erasing : php-bcmath-5.5.0-1.el6.remi.x86_64
15/28 Erasing : php-gd-5.5.0-1.el6.remi.x86_64
16/28 Erasing : php-mbstring-5.5.0-1.el6.remi.x86_64
17/28 Erasing : php-mcrypt-5.5.0-1.el6.remi.x86_64
18/28 Erasing : php-tidy-5.5.0-1.el6.remi.x86_64
19/28 Erasing : php-pgsql-5.5.0-1.el6.remi.x86_64
20/28 Erasing : php-pdo-5.5.0-1.el6.remi.x86_64
21/28 Erasing : php-intl-5.5.0-1.el6.remi.x86_64
22/28 Erasing : php-cli-5.5.0-1.el6.remi.x86_64
23/28 Erasing : php-process-5.5.0-1.el6.remi.x86_64
24/28 Erasing : php-xml-5.5.0-1.el6.remi.x86_64
25/28 Erasing : php-common-5.5.0-1.el6.remi.x86_64
26/28 waarschuwing: /etc/php.ini saved as /etc/php.ini.rpmsave
Erasing : php-pecl-jsonc-1.3.1-2.el6.remi.1.x86_64
27/28 Erasing : 1:php-pear-1.9.5-10.el6.remi.noarch
28/28 /usr/bin/pecl: regel 2: /usr/bin/php: Bestand of map bestaat
niet /usr/bin/pecl: regel 2: exec: Kan /usr/bin/php niet uitvoeren:
Bestand of map bestaat niet waarschuwing: /etc/pear.conf saved as
/etc/pear.conf.rpmsave Verifying :
php-bcmath-5.5.0-1.el6.remi.x86_64
1/28 Verifying : php-5.5.0-1.el6.remi.x86_64
2/28 Verifying :
php-pecl-apc-3.1.15-0.3.svn329913.el6.remi.1.x86_64
3/28 Verifying : php-php-gettext-1.0.11-4.el6.remi.noarch
4/28 Verifying : php-mbstring-5.5.0-1.el6.remi.x86_64
5/28 Verifying : php-intl-5.5.0-1.el6.remi.x86_64
6/28 Verifying : phpMyAdmin-4.0.4-1.el6.remi.noarch
7/28 Verifying : php-tcpdf-6.0.049-1.el6.noarch
8/28 Verifying : php-tcpdf-dejavu-sans-fonts-6.0.049-1.el6.noarch
9/28 Verifying : php-recode-5.5.0-1.el6.remi.x86_64
10/28 Verifying : php-mcrypt-5.5.0-1.el6.remi.x86_64
11/28 Verifying : php-pecl-memcache-3.0.8-1.el6.remi.1.x86_64
12/28 Verifying : php-common-5.5.0-1.el6.remi.x86_64
13/28 Verifying : php-cli-5.5.0-1.el6.remi.x86_64
14/28 Verifying : 1:php-pear-1.9.5-10.el6.remi.noarch
15/28 Verifying :
php-pecl-sqlite-2.0.0-0.3.svn313074.el6.remi.5.x86_64
16/28 Verifying : php-xml-5.5.0-1.el6.remi.x86_64
17/28 Verifying : php-pecl-mongo-1.4.1-1.el6.remi.1.x86_64
18/28 Verifying : php-tidy-5.5.0-1.el6.remi.x86_64
19/28 Verifying : php-pgsql-5.5.0-1.el6.remi.x86_64
20/28 Verifying : php-pdo-5.5.0-1.el6.remi.x86_64
21/28 Verifying : php-process-5.5.0-1.el6.remi.x86_64
22/28 Verifying :
php-pecl-igbinary-1.1.2-0.5.git3b8ab7e.el6.remi.1.x86_64
23/28 Verifying : php-pecl-memcached-2.1.0-6.el6.remi.5.x86_64
24/28 Verifying : php-gd-5.5.0-1.el6.remi.x86_64
25/28 Verifying : php-pecl-jsonc-1.3.1-2.el6.remi.1.x86_64
26/28 Verifying : php-gmp-5.5.0-1.el6.remi.x86_64
27/28 Verifying : php-mysqlnd-5.5.0-1.el6.remi.x86_64
28/28
Removed: php-pear.noarch 1:1.9.5-10.el6.remi
Dependency Removed: php.x86_64 0:5.5.0-1.el6.remi
php-bcmath.x86_64 0:5.5.0-1.el6.remi
php-cli.x86_64 0:5.5.0-1.el6.remi
php-common.x86_64 0:5.5.0-1.el6.remi
php-gd.x86_64 0:5.5.0-1.el6.remi
php-gmp.x86_64 0:5.5.0-1.el6.remi
php-intl.x86_64 0:5.5.0-1.el6.remi
php-mbstring.x86_64 0:5.5.0-1.el6.remi
php-mcrypt.x86_64 0:5.5.0-1.el6.remi
php-mysqlnd.x86_64 0:5.5.0-1.el6.remi
php-pdo.x86_64 0:5.5.0-1.el6.remi
php-pecl-apc.x86_64 0:3.1.15-0.3.svn329913.el6.remi.1
php-pecl-igbinary.x86_64 0:1.1.2-0.5.git3b8ab7e.el6.remi.1
php-pecl-jsonc.x86_64 0:1.3.1-2.el6.remi.1
php-pecl-memcache.x86_64 0:3.0.8-1.el6.remi.1
php-pecl-memcached.x86_64 0:2.1.0-6.el6.remi.5
php-pecl-mongo.x86_64 0:1.4.1-1.el6.remi.1
php-pecl-sqlite.x86_64 0:2.0.0-0.3.svn313074.el6.remi.5
php-pgsql.x86_64 0:5.5.0-1.el6.remi
php-php-gettext.noarch 0:1.0.11-4.el6.remi
php-process.x86_64 0:5.5.0-1.el6.remi
php-recode.x86_64 0:5.5.0-1.el6.remi
php-tcpdf.noarch 0:6.0.049-1.el6
php-tcpdf-dejavu-sans-fonts.noarch 0:6.0.049-1.el6
php-tidy.x86_64 0:5.5.0-1.el6.remi
php-xml.x86_64 0:5.5.0-1.el6.remi
phpMyAdmin.noarch 0:4.0.4-1.el6.remi
sudo yum --enablerepo=remi update
- 这只更新了 mysql,没有更新 apache 或 php
sudo yum --enablerepo=remi install php-pear
- 这又安装了 php,但是版本 5.4.40
Install 5 Package(s)
Total download size: 5.4 M Installed size: 21 M Is this ok [y/N]: y
Downloading Packages: (1/5): php-cli-5.4.40-1.el6.remi.x86_64.rpm
| 3.9 MB 00:00 (2/5): php-common-5.4.40-1.el6.remi.x86_64.rpm
| 959 kB 00:00 (3/5): php-pear-1.9.5-10.el6.remi.noarch.rpm
| 357 kB 00:00 (4/5):
php-process-5.4.40-1.el6.remi.x86_64.rpm |
64 kB 00:00 (5/5): php-xml-5.4.40-1.el6.remi.x86_64.rpm
| 174 kB 00:00
sudo yum --enablerepo=remi,remi-php55 update
- 这更新了 php 到版本 5.5.24,这就是我想要的
Dependency Installed: php-pecl-jsonc.x86_64 0:1.3.7-1.el6.remi.5.5
php-pecl-zip.x86_64 0:1.12.5-1.el6.remi.5.5
Updated: php-cli.x86_64 0:5.5.24-1.el6.remi
php-common.x86_64 0:5.5.24-1.el6.remi php-process.x86_64
0:5.5.24-1.el6.remi php-xml.x86_64 0:5.5.24-1.el6.remi
然后我重新启动了 apache 和 mysql。
现在,当我访问此服务器上的任何 (Wordpress) 网站时,它们要么显示 Apache 2 测试页,要么显示 index.php 的纯文本内容(没有 php 执行) .
我查看了 Whosebug,发现了一些关于添加的内容:
LoadModule php5_module modules/libphp5.so
但遗憾的是该文件不存在。
找到 libphp5.so 给出
/usr/lib64/httpd/modules/libphp5.so 但
LoadModule php5_module /usr/lib64/httpd/modules/libphp5.so
重新启动 apache 时出错..
我想我删除的包 php 多于预期,但我不确定哪些包丢失了,应该重新安装。谁能指出我正确的方向?并告诉我是否应该重新安装 apache?我宁愿不丢失任何配置..
如错误消息中所述,存在一个问题,因为它无法访问 'shared object file'。这可能发生在安装新东西之后,而不是 运行ning ldconfig。
因此,停止 httpd,安装 php 模块和 运行 ldconfig,然后重新启动 apache。
# ldconfig
# apachectl start
最终我以某种方式解决了它。我删除并(重新)安装了 httpd、php、php-common、php-cli、php-pear、php-[=23 中的所有内容=] 并且还安装了 httpd-devel 和 php-devel
在这个过程中我也在/etc/httpd/conf.d/
中手动创建了一个php.conf
我也 运行 这个来自 centos forums:
rpm -qa 'php*'
rpm -V php
最终在这个过程中创建了正确的 php.conf,并且在重新启动 apache 之后一切又恢复正常了。
我遇到了一些问题 运行 yum update
并执行了以下步骤使其工作:
sudo yum --enablerepo=remi,remi-php55 -y remove memcached
- 这只是删除了 memcached,其中一个包给出了错误sudo yum --enablerepo=remi,remi-php55 -y remove php-pear
- 这比我预料的要多..
Running Transaction Erasing : phpMyAdmin-4.0.4-1.el6.remi.noarch 1/28 waarschuwing: /etc/httpd/conf.d/phpMyAdmin.conf saved as /etc/httpd/conf.d/phpMyAdmin.conf.rpmsave Erasing : php-pecl-memcached-2.1.0-6.el6.remi.5.x86_64
2/28 Erasing : php-pecl-igbinary-1.1.2-0.5.git3b8ab7e.el6.remi.1.x86_64
3/28 Erasing : php-php-gettext-1.0.11-4.el6.remi.noarch
4/28 Erasing : php-pecl-mongo-1.4.1-1.el6.remi.1.x86_64
5/28 Erasing : php-pecl-sqlite-2.0.0-0.3.svn313074.el6.remi.5.x86_64
6/28 Erasing : php-pecl-memcache-3.0.8-1.el6.remi.1.x86_64
7/28 Erasing : php-pecl-apc-3.1.15-0.3.svn329913.el6.remi.1.x86_64
8/28 Erasing : php-5.5.0-1.el6.remi.x86_64
9/28 Erasing : php-gmp-5.5.0-1.el6.remi.x86_64
10/28 Erasing : php-mysqlnd-5.5.0-1.el6.remi.x86_64
11/28 Erasing : php-recode-5.5.0-1.el6.remi.x86_64
12/28 Erasing : php-tcpdf-dejavu-sans-fonts-6.0.049-1.el6.noarch 13/28 Erasing : php-tcpdf-6.0.049-1.el6.noarch
14/28 Erasing : php-bcmath-5.5.0-1.el6.remi.x86_64
15/28 Erasing : php-gd-5.5.0-1.el6.remi.x86_64
16/28 Erasing : php-mbstring-5.5.0-1.el6.remi.x86_64
17/28 Erasing : php-mcrypt-5.5.0-1.el6.remi.x86_64
18/28 Erasing : php-tidy-5.5.0-1.el6.remi.x86_64
19/28 Erasing : php-pgsql-5.5.0-1.el6.remi.x86_64
20/28 Erasing : php-pdo-5.5.0-1.el6.remi.x86_64
21/28 Erasing : php-intl-5.5.0-1.el6.remi.x86_64
22/28 Erasing : php-cli-5.5.0-1.el6.remi.x86_64
23/28 Erasing : php-process-5.5.0-1.el6.remi.x86_64
24/28 Erasing : php-xml-5.5.0-1.el6.remi.x86_64
25/28 Erasing : php-common-5.5.0-1.el6.remi.x86_64
26/28 waarschuwing: /etc/php.ini saved as /etc/php.ini.rpmsave
Erasing : php-pecl-jsonc-1.3.1-2.el6.remi.1.x86_64
27/28 Erasing : 1:php-pear-1.9.5-10.el6.remi.noarch
28/28 /usr/bin/pecl: regel 2: /usr/bin/php: Bestand of map bestaat niet /usr/bin/pecl: regel 2: exec: Kan /usr/bin/php niet uitvoeren: Bestand of map bestaat niet waarschuwing: /etc/pear.conf saved as /etc/pear.conf.rpmsave Verifying : php-bcmath-5.5.0-1.el6.remi.x86_64
1/28 Verifying : php-5.5.0-1.el6.remi.x86_64
2/28 Verifying : php-pecl-apc-3.1.15-0.3.svn329913.el6.remi.1.x86_64
3/28 Verifying : php-php-gettext-1.0.11-4.el6.remi.noarch
4/28 Verifying : php-mbstring-5.5.0-1.el6.remi.x86_64
5/28 Verifying : php-intl-5.5.0-1.el6.remi.x86_64
6/28 Verifying : phpMyAdmin-4.0.4-1.el6.remi.noarch
7/28 Verifying : php-tcpdf-6.0.049-1.el6.noarch
8/28 Verifying : php-tcpdf-dejavu-sans-fonts-6.0.049-1.el6.noarch 9/28 Verifying : php-recode-5.5.0-1.el6.remi.x86_64
10/28 Verifying : php-mcrypt-5.5.0-1.el6.remi.x86_64
11/28 Verifying : php-pecl-memcache-3.0.8-1.el6.remi.1.x86_64
12/28 Verifying : php-common-5.5.0-1.el6.remi.x86_64
13/28 Verifying : php-cli-5.5.0-1.el6.remi.x86_64
14/28 Verifying : 1:php-pear-1.9.5-10.el6.remi.noarch
15/28 Verifying : php-pecl-sqlite-2.0.0-0.3.svn313074.el6.remi.5.x86_64
16/28 Verifying : php-xml-5.5.0-1.el6.remi.x86_64
17/28 Verifying : php-pecl-mongo-1.4.1-1.el6.remi.1.x86_64
18/28 Verifying : php-tidy-5.5.0-1.el6.remi.x86_64
19/28 Verifying : php-pgsql-5.5.0-1.el6.remi.x86_64
20/28 Verifying : php-pdo-5.5.0-1.el6.remi.x86_64
21/28 Verifying : php-process-5.5.0-1.el6.remi.x86_64
22/28 Verifying : php-pecl-igbinary-1.1.2-0.5.git3b8ab7e.el6.remi.1.x86_64
23/28 Verifying : php-pecl-memcached-2.1.0-6.el6.remi.5.x86_64
24/28 Verifying : php-gd-5.5.0-1.el6.remi.x86_64
25/28 Verifying : php-pecl-jsonc-1.3.1-2.el6.remi.1.x86_64
26/28 Verifying : php-gmp-5.5.0-1.el6.remi.x86_64
27/28 Verifying : php-mysqlnd-5.5.0-1.el6.remi.x86_64
28/28Removed: php-pear.noarch 1:1.9.5-10.el6.remi
Dependency Removed: php.x86_64 0:5.5.0-1.el6.remi
php-bcmath.x86_64 0:5.5.0-1.el6.remi
php-cli.x86_64 0:5.5.0-1.el6.remi
php-common.x86_64 0:5.5.0-1.el6.remi
php-gd.x86_64 0:5.5.0-1.el6.remi
php-gmp.x86_64 0:5.5.0-1.el6.remi
php-intl.x86_64 0:5.5.0-1.el6.remi
php-mbstring.x86_64 0:5.5.0-1.el6.remi
php-mcrypt.x86_64 0:5.5.0-1.el6.remi
php-mysqlnd.x86_64 0:5.5.0-1.el6.remi
php-pdo.x86_64 0:5.5.0-1.el6.remi
php-pecl-apc.x86_64 0:3.1.15-0.3.svn329913.el6.remi.1
php-pecl-igbinary.x86_64 0:1.1.2-0.5.git3b8ab7e.el6.remi.1
php-pecl-jsonc.x86_64 0:1.3.1-2.el6.remi.1
php-pecl-memcache.x86_64 0:3.0.8-1.el6.remi.1
php-pecl-memcached.x86_64 0:2.1.0-6.el6.remi.5
php-pecl-mongo.x86_64 0:1.4.1-1.el6.remi.1
php-pecl-sqlite.x86_64 0:2.0.0-0.3.svn313074.el6.remi.5
php-pgsql.x86_64 0:5.5.0-1.el6.remi
php-php-gettext.noarch 0:1.0.11-4.el6.remi
php-process.x86_64 0:5.5.0-1.el6.remi
php-recode.x86_64 0:5.5.0-1.el6.remi
php-tcpdf.noarch 0:6.0.049-1.el6
php-tcpdf-dejavu-sans-fonts.noarch 0:6.0.049-1.el6
php-tidy.x86_64 0:5.5.0-1.el6.remi
php-xml.x86_64 0:5.5.0-1.el6.remi
phpMyAdmin.noarch 0:4.0.4-1.el6.remi
sudo yum --enablerepo=remi update
- 这只更新了 mysql,没有更新 apache 或 phpsudo yum --enablerepo=remi install php-pear
- 这又安装了 php,但是版本 5.4.40
Install 5 Package(s)
Total download size: 5.4 M Installed size: 21 M Is this ok [y/N]: y Downloading Packages: (1/5): php-cli-5.4.40-1.el6.remi.x86_64.rpm
| 3.9 MB 00:00 (2/5): php-common-5.4.40-1.el6.remi.x86_64.rpm | 959 kB 00:00 (3/5): php-pear-1.9.5-10.el6.remi.noarch.rpm
| 357 kB 00:00 (4/5): php-process-5.4.40-1.el6.remi.x86_64.rpm | 64 kB 00:00 (5/5): php-xml-5.4.40-1.el6.remi.x86_64.rpm
| 174 kB 00:00
sudo yum --enablerepo=remi,remi-php55 update
- 这更新了 php 到版本 5.5.24,这就是我想要的
Dependency Installed: php-pecl-jsonc.x86_64 0:1.3.7-1.el6.remi.5.5
php-pecl-zip.x86_64 0:1.12.5-1.el6.remi.5.5Updated: php-cli.x86_64 0:5.5.24-1.el6.remi
php-common.x86_64 0:5.5.24-1.el6.remi php-process.x86_64 0:5.5.24-1.el6.remi php-xml.x86_64 0:5.5.24-1.el6.remi
然后我重新启动了 apache 和 mysql。
现在,当我访问此服务器上的任何 (Wordpress) 网站时,它们要么显示 Apache 2 测试页,要么显示 index.php 的纯文本内容(没有 php 执行) .
我查看了 Whosebug,发现了一些关于添加的内容: LoadModule php5_module modules/libphp5.so
但遗憾的是该文件不存在。 找到 libphp5.so 给出 /usr/lib64/httpd/modules/libphp5.so 但 LoadModule php5_module /usr/lib64/httpd/modules/libphp5.so 重新启动 apache 时出错..
我想我删除的包 php 多于预期,但我不确定哪些包丢失了,应该重新安装。谁能指出我正确的方向?并告诉我是否应该重新安装 apache?我宁愿不丢失任何配置..
如错误消息中所述,存在一个问题,因为它无法访问 'shared object file'。这可能发生在安装新东西之后,而不是 运行ning ldconfig。 因此,停止 httpd,安装 php 模块和 运行 ldconfig,然后重新启动 apache。
# ldconfig
# apachectl start
最终我以某种方式解决了它。我删除并(重新)安装了 httpd、php、php-common、php-cli、php-pear、php-[=23 中的所有内容=] 并且还安装了 httpd-devel 和 php-devel
在这个过程中我也在/etc/httpd/conf.d/
php.conf
我也 运行 这个来自 centos forums: rpm -qa 'php*' rpm -V php
最终在这个过程中创建了正确的 php.conf,并且在重新启动 apache 之后一切又恢复正常了。