linux 安装PHP 过程
到现在终于安好了,把过程记录下来,嘿嘿。
我之前安装linux系统时,装了很多安装盘自带的安装包,装了之后很后悔,感觉用起来麻烦,而且版本估计是前两年的吧,都不是最新的,所以把机器上的PHP删了重新安装。
在php官网上下了php-5.3.6.tar.bz2。然后解压。
进入php-5.3.6.按照官网上的帮助文档。
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql
makemake install
[root@ShadowFiend php-5.3.6]# make installInstalling PHP SAPI module: apache2handler/usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/lib/apr-1/build/libtool' libphp5.la /usr/local/apache2/modules/usr/lib/apr-1/build/libtool --mode=install cp libphp5.la /usr/local/apache2/modules/libtool: install: cp .libs/libphp5.so /usr/local/apache2/modules/libphp5.solibtool: install: cp .libs/libphp5.lai /usr/local/apache2/modules/libphp5.lalibtool: install: warning: remember to run `libtool --finish /home/Gogo_yueyue/下载/php-5.3.6/libs'chmod 755 /usr/local/apache2/modules/libphp5.so[activating module `php5' in /usr/local/apache2/conf/httpd.conf]Installing PHP CLI binary: /usr/local/bin/Installing PHP CLI man page: /usr/local/man/man1/Installing build environment: /usr/local/lib/php/build/Installing header files: /usr/local/include/php/Installing helper programs: /usr/local/bin/ program: phpize program: php-configInstalling man pages: /usr/local/man/man1/ page: phpize.1 page: php-config.1Installing PEAR environment: /usr/local/lib/php/[PEAR] Archive_Tar - installed: 1.3.7[PEAR] Console_Getopt - installed: 1.3.0[PEAR] Structures_Graph- installed: 1.0.4[PEAR] XML_Util - installed: 1.2.1[PEAR] PEAR - installed: 1.9.2Wrote PEAR system config file at: /usr/local/etc/pear.confYou may want to add: /usr/local/lib/php to your php.ini include_path/home/Gogo_yueyue/下载/php-5.3.6/build/shtool install -c ext/phar/phar.phar /usr/local/binln -s -f /usr/local/bin/phar.phar /usr/local/bin/pharInstalling PDO headers: /usr/local/include/php/ext/pdo/
cp php.ini-development /usr/local/lib/php.ini
vi /usr/local/apache/conf/httpd.conf
AddType application/x-httpd-php .php .phtml
cd htdocsvi phpinfo.php
<?php phpinfo(); ?>