PHP:如何检查是否已正确安装并启用了库? [英] PHP: How to check whether a library has been properly installed and enabled?

查看:105
本文介绍了PHP:如何检查是否已正确安装并启用了库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在SO上遵循另一个问题(我不是PHP专家),我想知道本地笔记本电脑上是否已正确安装Zlib库.文档说不需要手动安装该库,但是使用该库的代码不起作用.

Following another question on SO (I am no PHP expert), I am wondering whether the Zlib library has been properly installed on my local laptop. Documentation says there should be no need to manually install this library, but code using this library does not work.

文档提到需要配置PHP --with-zlib[=DIR],但适用于4.3以下的版本.我在5.2.17.我已经检查了php.ini,但是看不到对此的引用.我的PHP系统已安装 Acquia Dev Desktop .

Documentation mentions a need to configure PHP --with-zlib[=DIR], but for versions below 4.3. I am on 5.2.17. I have checked php.ini, but I see no reference to it. My PHP system has been installed with Acquia Dev Desktop.

如何检查Zlib库是否已在本地PC上正确安装并启用?我应该去哪里看看?我应该找什么?谢谢.

How can I check whether the Zlib library has been properly installed and enabled on my local PC? Where should I take a look at? What should I look for? Thanks.

推荐答案

您可以使用phpinfo()获取有关库的完整信息

You can use phpinfo() to get full information about libraries

<?php
   phpinfo();
?>

或在您的PHP代码中测试给定功能

or in your PHP code test for a given function

if (function_exists("gzcompress")) {
  echo "OK";
} else {
  die("zlib missing");
}

这篇关于PHP:如何检查是否已正确安装并启用了库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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