LAMP环境搭建二

LAMP环境搭建(补php)

  1. L 代表服务器操作系统使用Linux
  2. A 代表网站服务使用的是Apache软件基金会中的httpd的模块
  3. M 代表网站后台使用的数据库时MySQL数据库
  4. P 代表网站是使用PHP语言开发
三安装 PHP

编译安装

cd/usr/local/php-5.6.39

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2.4/bin/apxs --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/src/mysql-5.6.43-linux-glibc2.12-x86_64 --with-png-dir --with-freetype-dir --with-openssl --with-mcrypt --with-libxml-dir --with-gd --with-bz2 --with-iconv-dir --with-zlib-dir --enable-soap --enable-gd-native-ttf

上面依赖啥模块就自己手动安装啥模块

# yum install -y libxml2-devel

# yum install -y libpng libpng-devel

# yum install -y libmcrypt-devel

# yum install -y openssl openssl-devel

# yum install -y bzip2 bzip2-devel

# yum install -y freetype freetype-devel

# yum install -y epel-release

# cd/usr/local/php-5.6.39

编译安装

mask && make install

creating libtool
appending configuration tag “CXX” to libtool

Generating files
configure: creating ./config.status
creating main/internal_functions.c
creating main/internal_functions_cli.c
±-------------------------------------------------------------------+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing 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. |
±-------------------------------------------------------------------+

Thank you for using PHP.

config.status: creating php5.spec
config.status: creating main/build-defs.h
config.status: creating scripts/phpize
config.status: creating scripts/man1/phpize.1
config.status: creating scripts/php-config
config.status: creating scripts/man1/php-config.1
config.status: creating sapi/cli/php.1
config.status: creating sapi/cgi/php-cgi.1
config.status: creating ext/phar/phar.1
config.status: creating ext/phar/phar.phar.1
config.status: creating main/php_config.h
config.status: executing default commands

configure: error: Cannot find MySQL header files under /usr/local/src/mysql-5.1.14-beta-linux-i686-glibc23/include/.

Note that the MySQL client library is not bundled anymore!

#/usr/local/apache2.4/bin/httpd –M

//若下面多了一条php5的模块,那就安装OK
在这里插入图片描述

查询php的相关信息:

#/usr/local/php/bin/php –i | less

#cat /usr/local/apache2.4/conf/httpd.conf

拷贝配置文件用于生产环境:

#cd /usr/local/php-5.6.39

#cp php.ini-production /usr/local/php/etc/php.ini

遇到错误

configure: error: Cannot find MySQL header files under /usr/local/src/mysql-5.1.14-beta-linux-i686-glibc23/include/.

Note that the MySQL client library is not bundled anymore!

解决方法

查看系统有没有安装mysql header

find / -name mysql.h

如果有。请指定–with-mysql=/跟正常路径。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值