在此之前,我已经安装了apache,mysql,以及一些组件,
包括autoconf, automake, bison, cmake, libjpeg, libpng, libmcrypt, libxml, mcrypt, mhash, ncurses, zlib.
打算编译安装PHP的主题和已知插件,其他需要的,到时侯需要用的时候再说吧。
]# ./configure --prefix=/usr/lib/php
--with-apxs2=/usr/local/apache2/bin/apxs
--with-mysql-sock=/usr/lib/mysql/data/mysql.sock
--with-mysql
--enable-xml --with-mcrypt --with-ttf --enable-magic-quotes --enable-fastcgi --enable-mbstring --enable-sysvsem
--with-iconv --enable-mbstring --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir
编译提示说找不到mcrypt,
错误信息:configure: error: mcrypt.h not found. Please reinstall libmcrypt
我确认已经安装mcrypt和libmcrypt,位置在/usr/lib,所以给出位置吧:--with-mcrypt=/usr/lib
编译参数:
./configure --prefix=/usr/lib/php
--with-apxs2=/usr/local/apache2/bin/apxs
--with-mysql-sock=/usr/lib/mysql/data/mysql.sock
--with-mysql
--enable-xml --with-mcrypt=/usr/lib --with-ttf --enable-magic-quotes --enable-fastcgi --enable-mbstring
--with-iconv --enable-mbstring --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --enable-sysvsem
再次运行,又提示:configure: error: Cannot find libmysqlclient under /usr.
我的mysql安装在/usr/lib/mysql下面,发现/usr/lib/mysql/lib目录,进去找了下发现一堆这个名字的文件,
.so,.so.18,失身么玩意我还不知到。
反正是有的。只是系统没有找到。系统在usr下面找当然找不到。
我给出mysql目录地址好了,--with-mysql=/usr/lib/mysql 。
再次修改编译参数
./configure --prefix=/usr/lib/php
--with-apxs2=/usr/local/apache2/bin/apxs
--with-mysql-sock=/usr/lib/mysql/data/mysql.sock
--with-mysql=/usr/lib/mysql
--enable-xml --with-mcrypt=/usr/lib --with-ttf --enable-magic-quotes --enable-fastcgi --enable-mbstring
--with-iconv --enable-mbstring --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --enable-sysvsem
OK 这个问题解决了
但是又有了新的问题,
Notice: Following unknown configure options were used:
--with-ttf
--enable-fastcgi
Check './configure --help'
不知道这两个东西是什么,反正暂时用不上,先删除掉吧。fastcgi好像听说过,现在也不需要。
编译参数:
./configure --prefix=/usr/lib/php
--with-apxs2=/usr/local/apache2/bin/apxs
--with-mysql-sock=/usr/lib/mysql/data/mysql.sock
--with-mysql=/usr/lib/mysql
--enable-xml --with-mcrypt=/usr/lib --enable-magic-quotes --enable-mbstring
--with-iconv --enable-mbstring --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --enable-sysvsem
OK编译安装成功
最后一步,一定要在httpd.conf里面添加php类型
#
# Filters allow you to process content before it is sent to the client.
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
AddType text/html .shtml
AddType application/x-httpd-php .php
AddOutputFilter INCLUDES .shtml
然后再重启httpd服务即可
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com