首页 » Linux » 安装php出现的囧事

安装php出现的囧事

 

lamp或者lnmp一般是先安装nginx,apache,mysql最后安装php。有时候系统里不需要安装mysql.就没有安装了。编译php时就用了没有数据库的参数,结果一直报:
configure: error: Cannot find MySQL header files under /usr/bin/.
Note that the MySQL client library is not bundled anymore!

说没有数据库资料。

最后发现是编译参数错了,少了一个n

–with-mysql=mysqlnd我写成了–with-mysql=mysqld少了一个n

所以一直不成功,弄了我好长时间。靠。

目前在5.3.*和5.5.*测试没有数据库环境都是可以安装成功的。

php版本目前最新的是7.0,没有6,从5.6直接跳到7

以下参数可以添加,也可以不添加。

–with-pdo-mysql=/usr/local/mysql
–with-mysqli=/usr/local/mysql/bin/mysql_config //mysqli扩展技术不仅可以调用MySQL的存储过程、处理MySQL事务,而且还可以使访问数据库工作变得更加稳定。

 

php编译参数:

 

./configure \
--prefix=/application/php-5.5.26 \
--with-mysql=mysqlnd \
--with-iconv-dir=/usr/local/libiconv \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir=/usr \
--enable-xml \
--disable-rpath \
--enable-safe-mode \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--with-curlwrappers \
--enable-mbregex \
--enable-fpm \
--enable-mbstring \
--with-mcrypt \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--enable-short-tags \
--enable-zend-multibyte \
--enable-static \
--with-xsl \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--enable-ftp

 

原文链接:安装php出现的囧事,转载请注明来源!

0