LAMP 1.4 PHP编译安装
2015-12-04 02:04
651 查看
1.下载
切换到指定目录下
下载php
切换到指定目录下
cd /usr/local/src
下载php
wget http://cn2.php.net/distributions/php-5.4.44.tar.gz[/code]
PHP 官方下载地址:http://www.php.net/downloads.php
解压缩tar zxf php-5.4.44.tar.gz
2.配置编译参数
编译参数过程中会出现的错误
configure: error: xml2-config not found. Please check your libxml2 installation.
解决办法是yum install -y libxml2-devel
configure: error: Cannot find OpenSSL's <evp.h>
解决办法yum install -y openssl openssl-devel
checking for BZip2 in default path... not found
configure: error: Please reinstall the BZip2 distribution
解决办法yum install -y bzip2 bzip2-devel
configure: error: png.h not found.
解决办法yum install -y libpng libpng-devel
configure: error: freetype.h not found.
解决办法yum install -y freetype freetype-devel
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
解决办法yum install -y epel-releaseyum install -y libmcrypt-devel
configure: error: jpeglib.h not found.
解决办法yum install libjpeg-devel -y
切换到该目录下cd php-5.4.44
编译参数./configure \ --with-apr=/usr/local/apr \ --prefix=/usr/local/php \ --with-apxs2=/usr/local/apache2/bin/apxs \ --with-config-file-path=/usr/local/php/etc \ --with-mysql=/usr/local/mysql \ --with-libxml-dir \ --with-gd \ --with-jpeg-dir \ --with-png-dir \ --with-freetype-dir \ --with-iconv-dir \ --with-zlib-dir \ --with-bz2 \ --with-openssl \ --with-mcrypt \ --enable-soap \ --enable-gd-native-ttf \ --enable-mbstring \ --enable-sockets \ --enable-exif \ --disable-ipv6echo $?
编译makeecho $?
安装make installecho $?
拷贝php配置文件cp php.ini-production /usr/local/etc/php.ini
修改apache配置文件vim /usr/local/apache2/conf/httpd.conf1.找到 #ServerName www.example.com:80 改为ServerName www.example.com:80 2.找到: <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all </Directory> 改为: <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Allow from all </Directory> 3.找到<IfModule dir_module> DirectoryIndex index.html </IfModule> 改为 <IfModule dir_module> DirectoryIndex index.html index.php </IfModule> 4.找到AddType application/x-compress .Z AddType application/x-gzip .gz .tgz 改为 AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddType application/x-httpd-php .php 5.找到 #Include conf/extra/httpd-vhosts.conf 改为 Include conf/extra/httpd-vhosts.conf
修改配置文件vim /usr/local/apache2/conf/extra/httpd-vhosts.confmkdir /data/www把最下面两段修改为 <VirtualHost *:80> DocumentRoot "/data/www" ServerName www.wangshaojun.com ServerAlias www.denny.com # ErrorLog "logs/dummy-host.example.com-error_log" # CustomLog "logs/dummy-host.example.com-access_log" common </VirtualHost>
查看配置文件是否有问题/usr/local/apache2/bin/apachectl -t
显示Syntax OK 说明配置没有问题,那么启动服务/usr/local/apache2/bin/apachectl start
查看有没有进程ps aux |grep httpd
相关文章推荐
- PHP基础--数据类型
- 写在PHP7发布之际的一些话
- PHP7和HHVM的性能之争?
- 关于php布尔值的输出问题
- PHP常驻内存与单例模式
- ThinkPHP导出EXCEL
- 关于php_curl无法载入的问题的解决
- ubuntu 12.04 php5.3 降级为 5.2
- PHP组合模式
- 64位win2003/win2008系统IIS6.0/7.5配置PHP的方法
- iis7.5安装配置php环境详细清晰教程,三步实现【图文】
- 敲-PHP与MySQL,JSON
- mkyaffs2image的制作方法
- 中小企业集群ntpd服务搭建
- 中小企业集群ntpd服务搭建
- 15个实用的PHP正则表达式
- thinkphp的一些笔记
- 织梦首页php301重定向
- 今天debug thinkphp的感想
- PHP基础--变量