Fedora 20 编译 PHP 5.5

git 官方地址:
git clone https://git.php.net/repository/php-src.git
或 github 官方镜像:
git clone git://github.com/php/php-src.git

cd php-src

签出5.5分支:
git checkout PHP-5.5

编译:
./buildconf
./configure

若出现:
configure: WARNING: bison versions supported for regeneration of the Zend/PHP parsers: 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.7 (found: none).
解决方法:
sudo yum install bison


./configure --disable-all
make
./sapi/cli/php -v
若编译成功,此时可以看到 PHP 版本信息
使用 Eclipse 开发 PHP:
将 php-src 导入:
import -> Existing Code as makefile Project

点击 Run Configurations -> C/c++ Application -> New Launch configuration

在 Main -> C/C++ Application 中输入:
./sapi/cli/php
在 Arguments -> Program arguments 中输入:
-i

在菜单栏点击:Run php-src Default
可以看到 Console 中输出的信息

如果出现警告:
Unresolved inclusion: 
解决方法:
项目属性 -> C/C++ General ->Paths and Symbols -> Includes -> GNU C -> Add,输入:
/usr/include/
等待 C/C++ Indexer 执行完毕,红色的警告将消失

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

14 − 14 =