来自 php-config 的 PHP 版本不匹配?

标签 php linux

我已经在我的 Linux 机器上手动编译并安装了 PHP 5.3.8,但是 php-config 给我的版本是 5.2.6。我怎样才能改变这个?我需要 php-config 才能知道确切的版本。 php -v 给我正确的版本 5.3.8。

php-config -h
Usage: /usr/local/bin/php-config [OPTION]
Options:
  --prefix            [/usr/local]
  --includes          [-I/usr/local/include/php -I/usr/local/include/php/main -I/usr /local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib]
  --ldflags           []
  --libs              [-lcrypt   -lcrypt -lrt -lresolv -lm -ldl -lnsl  -lxml2 -lxml2   
  -lxml2 -lcrypt -lxml2 -lxml2 -lxml2 -lcrypt ]
  --extension-dir     [/usr/local/lib/php/extensions/no-debug-non-zts-20060613]
  --include-dir       [/usr/local/include/php]
  --php-binary        [/usr/local/bin/php]
  --php-sapis         [cli cgi]
  --configure-options []
  --version           [5.2.6]
  --vernum            [50206]

ls -s which php which php-config给我这个:

25464 /usr/local/bin/php      4 /usr/local/bin/php-config

最佳答案

我怀疑您在编译安装之前没有删除旧版本的 php。运行:

ls -l `which php` `which php-config`

应该向您显示文件的创建时间,您可能会发现您的编译/安装版本不包括 php-config。

关于来自 php-config 的 PHP 版本不匹配?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8114838/

相关文章:

linux - 如何在 Amazon Linux AMI 上设置 cron 作业

php - 为什么 make 命名空间中没有定义命令?

php - Laravel 中的关系 0...1

php - 将值收集到变量中

linux - 选择系统调用在 n/w 应用程序中无限期挂起。

c++ - 我目前正在使用什么 c++ norme?

linux - psql 错误 : could not open file "address.csv" for reading: No such file or directory

php - 在 CakePHP 中一次存储多行

php - 从 View 文件夹中的文件导航到laravel中 View 文件夹中的另一个文件

linux - 如何在 Linux 中按名称获取文件的完整路径