ubuntu 12替php加载zlib扩展

WBOY
Release: 2016-06-13 13:04:55
Original
853 people have browsed it

ubuntu 12为php加载zlib扩展
今天编译了半天的php,安装完了以后发现少了zlib扩展,只好又找资料,在这篇文章找到了
http://www.ansen.org/add-extension-library-for-php.html

[root@Ansen zlib]# pwd
/root/lnmp/php-5.3.0/ext/zlib  #先进入到php的源代码目录
[root@Ansen zlib]#mv config0.m4 config.m4
[root@Ansen zlib]#/usr/local/php/bin/phpize #/usr/local/php为一开始安装php的目录 
[root@Ansen zlib]#./configure --with-php-config=/usr/local/php/bin/php-config
[root@Ansen zlib]#make
[root@Ansen zlib]# cp modules/zlib.so /usr/local/php5/lib/php/extension/
没有该extension目录,需要手动建立,目录名称可以自定义,在php.ini配置文件中配置好就好了
[root@Ansen zlib]#vi /usr/local/php5/lib/php.ini
添加extension=zlib.so
还需要在php.ini文件中把extension_dir指向到/usr/local/php/lib/php/extension/
注意这里最后的/不能少,然后重新启动nginx就可以了
Copy after login


另外今天通过apt-get install mysql-server 安装好以后,建立一个用户
grant all privileges on mycms.* to joolma@'%' identified by '123456';
flush privileges;
Copy after login

竟然无法通过命令mysql -h localhost -u joolma -p连接到数据库,网上找了半天,后来才发现还需要一条命令
grant all privileges on mysql.* to joolma@'localhost' identified by '123456';
在localhost上授权才行,我记得以前在windows中都是前面一条命令可以搞定的,到linux下就需要两条了

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template