首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Fedora 5上安装PHP5?

如何在Fedora 5上安装PHP5?
EN

Server Fault用户
提问于 2009-07-03 10:10:25
回答 3查看 2.9K关注 0票数 1

我试图在FC5上从源代码中安装FC5,一切都很好地配置和编译。但是,当我尝试运行php时,我会收到以下错误。

代码语言:javascript
复制
PHP Warning:  PHP Startup: mysql: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=0
These options need to match in Unknown on line 0

PHP Warning:  PHP Startup: mysqli: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=0
These options need to match in Unknown on line 0

PHP Warning:  PHP Startup: gd: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: ldap: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=0
These options need to match in Unknown on line 0

PHP Warning:  PHP Startup: mysql: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=0
These options need to match in Unknown on line 0

PHP Warning:  PHP Startup: mysqli: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=0
These options need to match in Unknown on line 0

PHP Warning:  PHP Startup: PDO: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=0
These options need to match in Unknown on line 0

PHP Warning:  PHP Startup: pdo_mysql: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=0
These options need to match in Unknown on line 0

PHP Warning:  PHP Startup: pdo_sqlite: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=0

我使用以下选项配置了PHP:

代码语言:javascript
复制
./configure --with-mysql --with-gd --enable-modules=php5 -with-zlib --enable-pdo=shared --with-pdo-sqlite=shared --with-sqlite=shared

谁知道这是怎么回事。我知道是模块不是正确的版本,但我不知道如何纠正这一点。

如何才能使它正确安装?

EN

回答 3

Server Fault用户

回答已采纳

发布于 2009-07-03 15:24:20

  1. 如果可能的话,升级Fedora 11。这是值得的。
  2. 如果您由于某些原因无法升级OS,请在没有mysql、gd等支持的情况下配置PHP,并查看是否可以使其工作。简单或简单的测试。如果这管用的话。然后升级mysql,然后只尝试使用-- with -mysql,不要同时添加其他库。如果这管用的话。然后升级zlib并添加zlib标志。如果像mysql这样的升级不起作用,那么升级其他的东西,然后处理mysql。工作需要一天多的时间。我希望这是值得的。
  3. 将此服务器的前向端口80移植到具有最新操作系统的服务器的端口80,如果这是可以接受的话。
票数 1
EN

Server Fault用户

发布于 2009-07-03 11:07:19

您是否首先删除了旧的PHP?看起来有些旧库仍然存在,新的PHP二进制文件正在尝试访问它们。

我不太愿意在基于RPM的发行版上从源代码中构建软件包,除非最终生成一个我可以安装的RPM。我的观点是,非基于RPM的安装在这样的机器上只是“粘稠”机器。

看起来雷米·科莱特正在为php-5和模块维护一些最近的RPM(实际上,几天前他刚刚为一堆Fedora发行版构建了PHP-5.3,但他在6!见:http://blog.famillecollet.com/post/2009/06/30/PHP-5.3.0-Released)。

我想看看他的RPM是否能做你想做的事情(http://rpms.famillecollet.com/fedora/5/或镜子)。如果您真的想从源代码编译(因为您可能想要really提供的更新的版本),我会从Remi的站点下载SRPM,安装它们,修改.specfiles以引用更新的版本,并使用他的.specfiles进行构建。(它可能在第一次不起作用,但是您应该能够找出破坏构建的更改,它将给您一些使用RPM的良好经验)。

您甚至可能会发现,他的用于FC6的PHP-5.3RPM在FC5上安装良好。

我定期为软件构建RPM包,以便安装到多台基于RPM的机器上(通常是CentOS)。从RPM安装新软件意味着我的“生产”机器保持干净,不需要安装编译器。这是我强烈推荐的策略。

票数 2
EN

Server Fault用户

发布于 2009-07-03 13:39:08

你为什么还在运行Fedora Core 5?我建议切换到支持寿命更长的东西,比如CentOS 5(顺便说一句,它有PHP5.1开箱)。你在运行Fedora三年前的版本,所以它已经过了两年了.

票数 2
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/35487

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档