suse linux中apache+php服务器安装

时间:2022-11-24 20:32:32

主站下载源码

tar zxvf httpd-2.2.4.tar.bz2
cd httpd-2.2.4

./configure
--prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so
--enable-ssl --enable-track-vars --enable-rewrite
--enable-mods-shared=most

出错error: ...No recognized SSL/TLS toolkit detected

去掉--enable-ssl ,从新configure不再报错。

make

make install

/usr/local/apache/bin/apachectl restart 可以启动apache

echo "/usr/local/apache/bin/apachectl -k start" >> /etc/init.d/boot.local系统启动时服务自动启动,

suse自启动项目是在/etc/init.d/boot.local文件中添加命令。Red Hat系统的对应文件是/etc/rc.d/rc.local。

安装php

tar zxvf php-5.2.12.tar.gz

./configure
--prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs
--with-mysql=/usr/local/mysql
--with-mysqli=/usr/local/mysql/bin/mysql_config --with-xml --with-png
--with-jpeg --with-zlib --with-freetype   --with-gd --enable-track-vars
--enable-mbstring=all

根据安装mysql与httpd的情况进行目录修改如下:

./configure
--prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs
--with-mysql=/usr/bin/mysql --with-mysqli=/usr/bin/mysql_config
--with-xml --with-png --with-jpeg --with-zlib --with-freetype  
--with-gd --enable-track-vars --enable-mbstring=all

报错: xml2-config not found.

安装libxml2 从yast软件管理中找到libxml2-devel安装!

configure成功!

make

make install

cp php.ini-dist /usr/local/php/lib/php/php.ini