一、uanme -a
二、安装mysql见:https://blog.51cto.com/10759919/2155412 这里最后启动mysql不用那个将配置信息放到/etc/inid中就可以用service mysql start启动了
三、安装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
---- apache成功!
四、开始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
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/src/services/php --with-config-file-path=/usr/local/src/services/php/etc --with-apxs2=/usr/local/src/services/apache2/bin/apxs --with-mysql=/usr/local/src/services/mysql/ --with-mysqli=/usr/local/src/services/mysql/bin/mysql_config --enable-mbstring=LANG --with-libxml-dir=/usr/local/src/services/libxml2
make
make install
这里报cat not find XXX 那就安装什么尤其是一些devel rpm -ivh xxx.rpm……
!!!!
这里报错php5.la那么重新编译zlib ./configure --prefix=/usr/local/src/services/zlib make && make install
然后重新编译php即可
!!!!
--开始配置php--
cp php.ini-production /usr/local/services/php/etc/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/src/services/php/lib/php/extensions/no-debug-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
<?php
phpinfo();
?>
重启apache apachectl restart
测试网页:浏览器输入 localhost/test.php 显示页面即可
./configure --prefix=/usr/local/src/services/php --with-config-file-path=/usr/local/src/services/php/etc --with-apxs2=/usr/local/src/services/apache2/bin/apxs --with-mysql=/usr/local/src/services/mysql --with-mysqli=/usr/local/src/services/mysql/bin/mysql_config --with-php-config=/usr/local/src/services/php/bin/php_config --enable-mbstring=LANG --enable-bcmath --enable-sockets --with-gd --with-zlib --with-curl=/usr/local/src/services/curl --with-zlib --with-libxml-dir=/usr/local/src/services/libxml2 --with-png-dir --with-jpeg-dir --with-freetype=/usr/local/src/services/freetype --with-iconv-dir --with-fpm-user=www --with-fpm-group=www --with-pcre-regex --enable-fpm --disable-phar --enable-calendar --enable-dba --enable-ftp --enable-gd-native-ttf --enable-gd-jis-conv --enable-pcntl --enable-xml --disable-rpath --enable-zip --disable-ipv6 --enable-ctype --with-gettext --enable-opcache --with-ldap