无法找到“扩展"我的 php.ini 文件的一部分,在 apache 2.0 中,它在哪里? [英] Unable to find the "extensions" portion of my php.ini file, in apache 2.0, where is it?

查看:21
本文介绍了无法找到“扩展"我的 php.ini 文件的一部分,在 apache 2.0 中,它在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的 Ubuntu、Apache 2、php 框中添加对 GD 扩展的支持.然而,我的 php.ini 文件似乎与 INI 文件的大多数版本不同,而且它们似乎没有 ; 扩展注释或占位符.这搬到哪里去了?他们是新位置还是添加扩展的新方法?

I'm trying to add support for the GD extension on my Ubuntu, Apache 2, php box. However my php.ini file does not seem to be the same as most versions of the INI file and it appears that their are no ;extensions comments or a place holder for them. Where did this move to? Is their a new location or new method for adding extensions?

我不知所措,我只找到了 2 个 php.ini 文件.一种用于 Apache 2,一种用于命令行界面.

I'm at a loss, I only found 2 php.ini files. One for Apache 2 and one for the command line interface.

最终我问这个问题是因为错误的正常修复Undefined offset: 1 in [...]images.php on line 50 Fatal error: Call to undefined function imagecreatefrompng() in [...]functions.php 在第 309 行 不起作用.

Ultimately I'm asking this question because the normal fix for the error Undefined offset: 1 in [...]images.php on line 50 Fatal error: Call to undefined function imagecreatefrompng() in [...]functions.php on line 309 does not work.

推荐答案

大多数发行版(包括 Ubuntu)通常将 PHP 扩展的 .ini 文件保存在与主 .ini 文件不同的子目录中.

Most distros, Ubuntu included, generally keep PHP extensions' .ini files in a seperate sub-dir from the main .ini file.

您应该有一个 /etc/php5 目录,其中 conf.d 子目录用于主要配置,以及 apachecli 各个版本的子目录.

You should have a /etc/php5 directory, with conf.d sub-dir for the main configuration, and apache and cli sub-dirs for the individual versions.

然而,Ubuntu 有一个 php5-gd 包,它会自动安装扩展,所以不需要修改 .ini 文件,除非你必须自己编译特定版本的 GD.

However, Ubuntu has a php5-gd package which will install the extension automatically, so hacking up the .ini files should NOT be necessary, unless you have to compile a specific version of GD yourself.

这篇关于无法找到“扩展"我的 php.ini 文件的一部分,在 apache 2.0 中,它在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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