php使用说明:
当php编译完成后,php的bin目录下会有phpize这个脚本文件。在编译你要添加的扩展模块之前,执行以下phpize就可以了;
[root@ ~] cd /home/ftproot/php-5.3.0
[root@localhost php-5.3.0]# /usr/local/php/bin/phpize //脚本文件,目的是搭建动态模块的环境,该命令一定要使用在php的模块文件夹主目录下,这里报错Cannot find config.m4。因为phpize要根据模块生成模块的配置文件放在模块文件夹下面
Make sure that you run '/usr/local/php/bin/phpize' in the top level source directory of the module 所以我们先
[root@localhost php-5.3.0]# cd ext/curl/
[root@localhost curl]# /usr/local/php/bin/phpize
[root@localhost curl]# ./configure --with-php-config=/usr/local/php/bin/php-config 注意:在没有在模块根文件夹下执行'/usr/local/php/bin/phpize的话是没有configure配置文件的!配置如果不报错就继续
[root@localhost curl]# make
[root@localhost curl]# make install
[root@localhost curl]# ll /usr/local/php/lib/php/extensions/no-debug-zts-20090626/
-rwxr-xr-x 1 root root 2760042 Aug 12 01:57 curl.so
此时我们发现curl.so已经copy到php默认的扩展文件夹里了,好了,马上要大功告成了,现在在php.ini里添加对curl.so的支持
[root@localhost curl]# vi /usr/local/php/lib/php.ini
增加extension=curl.so,好了php设置完成,现在重启web就行了
[root@localhost curl]#/usr/local/web/apache/bin/apachectl restart
查看phpinfo可以看到支持curl了