suse 11安装php7,suse11sp4搭建LAMP环境

一、uanme -a

三、安装apache:

SUSE 11 自带安装apache2,如果安装了,请卸载:

linux-1z88:/home/jie # zypper rm apache

1、tar -zxf apr-1.4.6.tar.gz

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

make

make install

不报错的原则下一个

2、tar -zxf apr-util-1.4.1.tar.gz

./configure --prefix=/usr/local/services/apr-util --with-apr=/usr/local/services/apr/bin/apr-1-config

make

make install

3、tar -zxvf  pcre-8.30.zip

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

make

make install

4、tar -zvxf httpd-2.4.2.tar.gz

./configure --prefix=/usr/local/services/apache2 --with-apr=/usr/local/services/apr/ --with-apr-util=/usr/local/services/apr-util/ --with-pcre=/usr/local/services/pcre/

make

make install

--开始配置apache--

cd /usr/local/services/apache2/conf

vi httpd.conf中搜索ServerName改成下面,并将注释打开

ServerName localhost:80

添加环境变量:

vim /etc/profile

export PATH=$PATH:/usr/local/services/apache2/bin

生效环境变量:source /etc/profile

启动apache: apachectl start

----

四、开始PHP安装配置

SUSE 11 自带安装php,如果安装了,请卸载:

linux-1z88:/home/jie # zypper rm php

安装JPEG6 jpegsrc.v6b.tar.gz

1.# mkdir -p /usr/local/services/jpeg6

2.# mkdir -p /usr/local/services/jpeg6/bin

3.# mkdir -p /usr/local/services/jpeg6/lib

4.# mkdir -p /usr/local/services/jpeg6/include

5.# mkdir -p /usr/local/services/jpeg6/man

6.# mkdir -p /usr/local/services/jpeg6/man1

7.# mkdir -p /usr/local/services/jpeg6/man/man1

8.# tar -zvxf jpegsrc.v6b.tar.gz

1、tar -zvxf jpegsrc.v6b.tar.gz

CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/services/jpeg6/ --enable-shared --enable-static

make

make install

2、tar -zxvf zlib-1.2.5.tar.gz

CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/services/zlib

make

make install

3、tar -jvxf  libpng-1.5.13.tar.bz2

CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/services/libpng/

make

make install

4、tar -zvxf freetype-2.4.10.tar.gz

CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/services/freetype

make

make install

5、tar -zxvf GD-2.0.33.tar.gz

CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/services/gd2/ --with-jpeg=/usr/local/services/jpeg6/ --with-png=/usr/local/services/libpng/ --with-zlib  --with-freetype=/usr/local/services/freetype

make

make install

-------

问题: 编译GD库时,报错:gd_png.c:15:53: error: png.h: No such file or directory

解决:进入gd安装包, vi gd_png.c

#include “png.h”

替换成:

#include “/usr/local/services/libpng/include/png.h”

然后再make就可以了

-------

6、tar -zxvf curl-7.19.4.tar.gz

CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/services/curl

make

make install

7、tar -zxvf libxml2-2.7.7.tar.gz

CFLAGS="-O3 -fPIC"  ./configure --prefix=/usr/local/services/libxml2 --with-zlib=/usr/local/services/zlib

make

make install

8、tar -zxvf php-5.6.36.tar.gz

CFLAGS="-O3 -fPIC"  ./configure --prefix=/usr/local/services/php --with-config-file-path=/usr/local/services/php/etc --with-libxml-dir --with-apxs2=/usr/local/services/apache2/bin/apxs --enable-inline-optimization --enable-shared --enable-opcache --enable-fpm --enable-bcmath --enable-soap --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --enable-zip --with-mysql=/root/mysql --enable-mbstring --with-jpeg-dir --with-png-dir --with-freetype-dir --with-gd2

make

make install

checking for the location of libXpm... no

checking for FreeType 2... yes

checking for T1lib support... no

checking whether to enable truetype string function in GD... no

checking whether to enable JIS-mapped Japanese font support in GD... no

If configure fails try --with-vpx-dir=

checking for jpeg_read_header in -ljpeg... no

configure: error: Problem with libjpeg.(a|so). Please check config.log for more information.

----------------------------------------cp -frp /usr/lib64/libpng* /usr/lib/

libpng-devel-1.5.13-7.el7_2.x86_64安装这个如果报错用

rpm -ivh libpng-devel-1.5.13-7.el7_2.x86_64.rpm --force --nodeps:

----继续执行:

./configure --prefix=/usr/local/services/php --with-config-file-path=/usr/local/services/php/etc --with-libxml-dir --with-apxs2=/usr/local/services/apache2/bin/apxs --enable-inline-optimization --enable-shared --enable-opcache --enable-fpm --enable-bcmath --enable-soap --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --enable-zip --with-mysql=/root/mysql --enable-mbstring --with-jpeg-dir --with-png-dir --with-freetype-dir --with-gd2

----

thank you for using php.--

make--报错:make: *** [libphp5.la] Error 1

rpm -ivh libtool-ltdl-devel-2.2.6-15.5.el6.x86_64.rpm

make clean

然后make

还是报错:

/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../lib64/libxml2.a: error adding symbols: Bad value

collect2: ld returned 1 exit status

make: *** [libphp5.la] Error 1

--开始配置php--

cp php.ini-production /usr/local/services/php/lib/php.ini

修改php.ini参数,使其符合zabbix的要求:

 memory_limit=128M

 post_max_size=16M

 upload_max_filesize=2M

 max_execution_time=300

 max_input_time=300

always_populate_raw_post_data = -1

extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/mysqli.so

date.timezone= Asia/Shanghai

.修改Apache2配置httpd.conf

在AddType application/x-gzip .gz .tgz 插入如下内容

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

进入根目录编辑测试文件: cd /usr/local/services/apache2/htdocs

.cat > test.php

phpinfo();

?>

重启apache apachectl restart

测试网页:浏览器输入 localhost/test.php 显示结果:

这里:

介绍一些cnfigure是用来生成makefile

make进行编译从makefile中获取

make install进行安装

make clean进行清理临时文件

标签:enable,tar,make,suse11sp4,LAMP,usr,services,local,搭建

来源: https://blog.csdn.net/no2017ok/article/details/88993813

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值