欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

apache + php环境搭建

程序员文章站 2022-04-07 16:21:20
...

apr下载链接地址:http://apr.apache.org/download.cgi ./configure --prefix=/usr/local/apr/; make; make install; apr-util下载链接地址:http://download.chinaunix.net/download/0001000/472.shtml ./configure --prefix=/usr/local/apr-util/ --with-a

apr下载链接地址:http://apr.apache.org/download.cgi

./configure --prefix=/usr/local/apr/;

make;
make install;

apr-util下载链接地址:http://download.chinaunix.net/download/0001000/472.shtml

./configure --prefix=/usr/local/apr-util/ --with-apr=/usr/local/apr;
make;
make install;
pcre下载链接地址:http://sourceforge.net/projects/pcre/files/pcre/
./configure --prefix=/usr/local/pcre/
;make;
make install;

apache下载地址http://httpd.apache.org/

./configure --prefix=/usr/local/www/apache2/ --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre/
make
make install

测试apache服务器

修改httpd.conf。
将 #ServerName www.example.com:80 修改为 ServerName 127.0.0.1:80(localhost:80)

cd /usr/local/www/apache2/
./bin/apachectl -k start
./bin/apachectl -k stop
./bin/apachectl -k restart

libxml2-2.7.4.tar.gz下载链接:http://download.chinaunix.net/download.php?id=28497&ResourceID=6095

./configure --prefix=/usr/local/

make

make install

php下载地址:http://php.net/get/php-5.5.19.tar.gz/from/a/mirror
./configure --prefix=/usr/local/php/ --enable-mbstring --with-apxs2=/usr/local/www/apache2/bin/apxs
make
make install

因为一般安装后的php目录$php/lib下没有php的配置文件,需要把解压目录下的php.ini-recommended复制到php的lib目录
sudo cp php.ini-recommended /home/guandl/webenv/php528/lib/php.ini

8、修改apache 的配置文件 httpd.conf
增加一下内容
LoadModule php5_module modules/libphp5.so 安装php时候已经自动生成
AddType application/x-httpd-php .php



linux php环境配置:
export PATH=$PATH:/usr/local/php/bin/
echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/home/hdfs/java-current//bin:/home/hdfs/hadoop-current/bin:/opt/app/hive-0.7.1-cdh3u5/bin:/home/dcplatform/mfs/sbin:/home/dcplatform/mfs/bin:/root/bin:/usr/local/php/bin/