Php的安装以及验证apache
Php安装
tar jxf php-5.3.8.tar.bz2
cd php-5.3.8
./configure --with-apxs2=/usr/local/apache2/bin/apxs--with-mysql
make
make install
编译php报错情况
php-5.3.8]# ./configure--with-apxs2=/usr/local/apache/bin/apxs --with-mysql
checking for specifiedlocation of the MySQL UNIX socket... no
configure: error: Cannotfind MySQL header files under yes.
Note that the MySQLclient library is not bundled anymore!
原因是没有找到mysql库的位置
现在把上述命令改成如下:
./configure--with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql
如果编译成功的话应该显示如下结束信息:
Generatingfiles
updatingcache ./config.cache
creating./config.status
creatingphp5.spec
creatingmain/build-defs.h
creatingscripts/phpize
creatingscripts/man1/phpize.1
creatingscripts/php-config
creatingscripts/man1/php-config.1
creatingsapi/cli/php.1
creatingmain/php_config.h
creatingmain/internal_functions.c
creatingmain/internal_functions_cli.c
+--------------------------------------------------------------------+
|License:|
|This software is subject to the PHP License, available in this |
|distribution in the file LICENSE. Bycontinuing this installation |
|process, you are bound by the terms of this license agreement. |
|If you do not agree with the terms of this license, you must abort |
|the installation process at this point. |
+--------------------------------------------------------------------+
Thankyou for using PHP.
截图如下:
cp php.ini-development /usr/local/lib/php.ini
vi /usr/local/apache/conf/httpd.conf 添加下列行
LoadModule php5_module modules/libphp5.so