日期:2014-05-17 浏览次数:20986 次
工作需要,让我尽快部署一个php项目。赶紧google,按部就班。
?
1.安装apache
?
wget http://labs.renren.com/apache-mirror/httpd/httpd-2.2.15.tar.gz tar zxvf httpd-2.2.15.tar.gz cd httpd-2.2.15 ./configure --prefix=/usr/local/httpd make && make install /usr/local/httpd/bin/apachctl start 打开浏览器,输入 http://127.0.0.1 看到 It works! 说明安装成功
?
2.安装php
?
wget http://cn.php.net/get/php-5.3.2.tar.gz/from/cn2.php.net/mirror tar zxvf php-5.3.2.tar.gz cd php-5.3.2 ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/httpd/bin/apxs --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql make && make install cp -p php.ini.dist /usr/local/php/php.ini?
?
3.配置 php
?
??Paths and Directories
include_path = "/usr/local/php/includes" Dynamic Extensions extension=php_mysql.dll extension=php_pdo.dll extension=php_pdo_mysql.dll?
4.配置Apache
?
?
DocumentRoot "/var/www" <Directory "/var/www"> Allow from all </Directory>?
?
?<IfModule dir_module>
DirectoryIndex index.html index.php </IfModule>
?
?
?
?
<VirtualHost 192.168.1.111> ServerName xx DocumentRoot app_root </VirtualHost>?
5.在 /var/www/ 下新建test.php?
?
<?php echo(phpinfo()); ?>
?? 重启apache,打开浏览器 输入 http://127.0.0.1/test.php,会看到php的配置信息。
?
?? 打开浏览器,输入 ?http://192.168.1.111 ?会看到项目
?