您好,欢迎访问一九零五行业门户网

linux 下php环境搭建

1、安装mysql、zlib等
问题记录
1、configure: error: cannot find mysql header files under /usr/include/mysql.
note that the mysql client library is not bundled anymore!
提示我找不到mysql header files
上网查了一下,用find / -name mysql.h查到确实存在/usr/include/mysql/mysql.h的
我的mysql是用官方rpm包安装的
server client devel share-compat 都装了...
初进入linux领域,求大神指点,感激不尽
哦,估计多半是64位的问题,在64位上装软件遇到的问题,很多时候都是因为库路径的问题,按dongboemil应该是可以解决的。要么php指定预配置参数mysql的库路径,要么就是把mysql的库复制或软链接到php默认寻找的目录。
-with-mysql=/usr/include/mysql,这个参数应该不对,
把它改为
--with-mysql

--with-mysql=/usr
试试
因为你mysql是rpm装的,按系统路径来的
如果还是不行,再说
注意,每次重新预配置,先这样:
make clean
再重新预配置,进行编译
2、
编译安装php出现configure: error: mysql configure failed. plea
好久没有编译安装过php了,为了玩nginx.没法子,编译一次来测试.我加的编译的参数是:
# ./configure cprefix=/usr/local/php cwith-config-file-path=/etc cwith-gd cenable-gd-native-ttf cwith-mysql cwith-iconv-dir cwith-freetype-dir cwith-jpeg-dir cwith-png-dir cwith-zlib cwith-libxml-dir cenable-xml cdisable-debug cdisable-rpath cenable-discard-path cenable-safe-mode cenable-bcmath cenable-shmop cenable-sysvsem cenable-inline-optimization cwith-curl cwith-curlwrappers cenable-mbregex cenable-fastcgi cenable-force-cgi-redirect cenable-mbstring cwith-mcrypt
没想到老是出下面的错
checking for mysql_close in -lmysqlclient… no
checking for mysql_error in -lmysqlclient… no
configure: error: mysql configure failed. please check config.log for more information.
google很久,都讲下面的答案,晕,这种也叫答案,那我不是还要重新编译一次mysql.这个php就很麻烦了.这个一定不对.
网查找说:安装php的时候没有指定一下mysql的安装目录。但是我已经指定了,所以这个说法是错误的,其实主要原因是 mysql-level没有装,也就是mysql的版本不对,应该换
mysql-max-5.0.21版本(包含所有mysql相关内容的软件包)
/usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.so when searching for -lmysqlclient
/usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
configure: failed program was:
#line 59854 configure
#include confdefs.h
在看看config.log提示的错….哦.原来是版本有问题.想起我的系统都是x86的,lib都是64位的.所以解决方法很容易.
这个libmysqlclient.a library 是在 /usr/lib64/mysql, 不是在 /usr/lib/mysql.
所以可以做下面的方法来解决
#export ldflags=-l/usr/lib64/mysql
or
请将makefile里面的
-l/usr/lib/mysql
改为
-l/usr/lib64/mysql
以上就介绍了linux 下php环境搭建,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。
其它类似信息

推荐信息