安装PHP Zip扩展 [英] Installing PHP Zip Extension

查看:714
本文介绍了安装PHP Zip扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装PHP Zip扩展。



我的服务器没有外部网络连接,所以我自己从PECL下载: http://pecl.php.net/package/zip 。我选择了1.10.2,最新的稳定版本,并将其传输到我的服务器。



我跑了:

  pear install zip-1.10.2.tgz 

并添加

  extension = zip.so 

到php.ini。我可以看到zip.so被创建,并放置在正确的extension_dir文件夹中。我重新启动了apache,然后检查它是否通过运行加载:

  php -m 



尽管如此,zip仍然不在该列表中。



我缺少一个步骤或做错了什么?



其他可能很重要的东西:



CentOS
Apache 2.2.3
PHP 5.2.16

解决方案

几个 php.ini 文件,一个用于CLI,一个用于apache。运行 php --ini ,查看CLI ini位置在哪里。


I'm attempting to install the PHP Zip extension.

My server does not have external internet access, so I downloaded it myself from PECL: http://pecl.php.net/package/zip. I chose 1.10.2, the latest "stable" release, and transferred it to my server.

I ran:

pear install zip-1.10.2.tgz

and added

extension=zip.so

to php.ini as instructed. I can see that zip.so was created and placed in the right extension_dir folder as well. I restarted apache and then checked to see if it was loaded by running:

php -m

Despite all of this, "zip" is still not in that list.

Am I missing a step or doing something wrong? I thought this should be really simple, and I'm starting to feel pretty dumb, haha.

Other probably important stuff:

CentOS Apache 2.2.3 PHP 5.2.16

解决方案

You may have several php.ini files, one for CLI and one for apache. Run php --ini to see where the CLI ini location is.

这篇关于安装PHP Zip扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆