ubuntu php 源码安装_PHP: 安装 - Manual

Here is how I got it working under Linux Ubuntu distro - WITHOUT USE PECL:

We will download both, PHP and Pthread without PECL

1 - Get PHP version

For this example we will use version: 5.4.36

# wget http://www.php.net/distributions/php-5.4.36.tar.gz

2- Get Pthreads version:

I'm using an old version but, you could take any one

# wget http://pecl.php.net/get/pthreads-1.0.0.tgz

Extract both, php and pthreads versions

#tar zxvf php-5.4.36.tar.gz

#tar zxvf pthreads-1.0.0.tgz

3- Move Pthreads to php/ext folder. Inside version of PHP downloaded at item 1.

4- Reconfigure sources

# ./buildconf --force

# ./configure --help | grep pthreads

You have to see --enable-pthreads listed. If do not, clear the buidls with this commands:

# rm -rf aclocal.m4

# rm -rf autom4te.cache/

# ./buildconf --force

5 - Inside php folder run configure command to set what we need:

# ./configure --enable-debug --enable-maintainer-zts --enable-pthreads --prefix=/usr --with-config-file-path=/etc

6 - Install PHP

We will run make clear just to be sure that no other crashed build will mess our new one.

# make clear

# make

# make install

7 - Copy configuration file of PHP and add local lib to include path

# cp php.ini-development /etc/php.ini

Edit php.ini and set Include_path to be like this:

Include_path = “/usr/local/lib/php”

9 - Check Modules

# php -m (check pthread loaded)

You have to see pthreads listed

10 - If pthread is not listed, update php.ini

# echo "extension=pthreads.so" >> /etc/php.ini

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值