suchen
Heimphp教程php手册Solaris 10整合apache与php过程及出错处理

Solaris 10整合apache与php过程及出错处理

Jun 13, 2016 am 11:01 AM
apachephpsolarisVorgesetzterUnd出错处理整合过程

前几天,我在solaris 10上整合apache与php,其间遇到一些问题,很有代表性,在这里把相关的过程及处理措施记录下来,希望对大家有所帮助。

与solaris 9不同的是,solaris 10已经默认安装GNU开发工具(GCC,make等)。但默认的环境变量没有把相关的路径设置进去—看路径是否被设置进去,只要执行不带选项和参数的命令gcc就知道了—用find搜索文件make和gcc,然后把路径写进文件/etc/profile,我的系统的/etc/profile路径设置如下所示:

export  PATH=$PATH:/usr/ccs/bin:/usr/sfw/bin

改完后执行source /etc/profile就可以了。鉴于solaris 10自带的tar不太方便,用GNU tar代替它,其过程如下:

gunzip -d tar-1.16.tar.gztar xvf tar-1.16.tarcd tar-1.16./configure -prefix=/usr/local/gnutar //指定目录,否则可能报错makemake install    //把包安装在目录/usr/local/gnutar了mv /usr/sbin/tar  /usr/sbin/tar.orig  //把系统自带的vi移动到一边,
                                以便万一发生意外能够恢复回来//ln –s /usr/local/gnutar/bin/tar  /usr/sbin/tar

接下来安装apache,其过程如下:

cd /roottar zxvf httpd-2.2.0.tar.gzcd httpd-2.2.0./configure –prefix=/usr/local/apache2 –enable-so makemake instal  

察看是否生成目录/usr/local/apache2便知apache是否被正确安装。

安装php,其过程如下:

cd /roottar zxvf php-5.2.0.tar.gzcd php-5.2.0./configure -prefix=/usr/local/php -with-apxs2
=/usr/local/apache2/bin/apxs ……… 

这个过程不能正常运行下去,出现下面的报错信息:

Configuring extensionschecking whether to enable LIBXML support... yeschecking libxml2 install dir... nochecking for xml2-config path... /usr/bin/xml2-configconfigure: error: libxml2 version 2.6.11 or greater required.

这表明系统自带的libxml2版本低,需要2.6.11以上的版本。有2种办法解决这个问题:升级libxml2和重新安装一个libxml2。在运行业务的solaris 环境,升级是一个十分冒险的办法,我们这里有很多程序员胡乱升级软件包把系统弄崩溃的先例,所以强烈建议象我一样保守,重新安装一个新的libxml2。只要我们在源码安装过程中指定了安装目录,安装了新的libxml2后不会对系统产生任何危害,当然占据那一点磁盘空间是微不足道的了。下面是安装一个新的 libxml的步骤:

cd /roottar zxvf libxml2-2.6.26.tar.gz./configure –prefix=/usr/local/libxmlmakemake install

这时我们再回来安装php

cd /root/php-5.2.0./configure -prefix=/usr/local/php5 -with-apxs2=/usr/local/apache2/bin/apxs
-with-libxml-dir=/usr/local/libxml   //配置很顺利的完成了makemake install

最后一个步骤是配置和测试,实际上只需要修改apache的配置文件httpd.conf。由于在php的配置过程中使用了选项—with-apxs,因此会在htppd.conf文件中插入“LoadModule php5_module modules/libphp5.so”这一行,先检查一下看受否被自动写入;然后再手动插入行“AddType application/x-httpd-php .php .phtml”,注意:.php,.phtml前面各有一个空格,没有这个空格将不能正常解析php页面,这是一个很容易忽视的问题,请初学者留意。写一个最简单的测试文件index.php,包含“”,把它保存在apache根文档所在的目录(这里是/usr/local/apache/htdocs/index.php)。执行/usr/local/apache/bin/apachectl start启动apache守护进程,从浏览器输入

Stellungnahme
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn

Heiße KI -Werkzeuge

Undresser.AI Undress

Undresser.AI Undress

KI-gestützte App zum Erstellen realistischer Aktfotos

AI Clothes Remover

AI Clothes Remover

Online-KI-Tool zum Entfernen von Kleidung aus Fotos.

Undress AI Tool

Undress AI Tool

Ausziehbilder kostenlos

Clothoff.io

Clothoff.io

KI-Kleiderentferner

AI Hentai Generator

AI Hentai Generator

Erstellen Sie kostenlos Ai Hentai.

Heißer Artikel

R.E.P.O. Energiekristalle erklärten und was sie tun (gelber Kristall)
4 Wochen vorBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Beste grafische Einstellungen
4 Wochen vorBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. So reparieren Sie Audio, wenn Sie niemanden hören können
4 Wochen vorBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: Wie man alles in Myrise freischaltet
1 Monate vorBy尊渡假赌尊渡假赌尊渡假赌

Heiße Werkzeuge

Dreamweaver CS6

Dreamweaver CS6

Visuelle Webentwicklungstools

Sicherer Prüfungsbrowser

Sicherer Prüfungsbrowser

Safe Exam Browser ist eine sichere Browserumgebung für die sichere Teilnahme an Online-Prüfungen. Diese Software verwandelt jeden Computer in einen sicheren Arbeitsplatz. Es kontrolliert den Zugriff auf alle Dienstprogramme und verhindert, dass Schüler nicht autorisierte Ressourcen nutzen.

SublimeText3 Linux neue Version

SublimeText3 Linux neue Version

SublimeText3 Linux neueste Version

MantisBT

MantisBT

Mantis ist ein einfach zu implementierendes webbasiertes Tool zur Fehlerverfolgung, das die Fehlerverfolgung von Produkten unterstützen soll. Es erfordert PHP, MySQL und einen Webserver. Schauen Sie sich unsere Demo- und Hosting-Services an.

WebStorm-Mac-Version

WebStorm-Mac-Version

Nützliche JavaScript-Entwicklungstools