Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to find the "extensions" portion of my php.ini file, in apache 2.0, where is it?

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?

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

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.

like image 740
JustinKaz Avatar asked May 09 '11 15:05

JustinKaz


1 Answers

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

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.

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.

like image 68
Marc B Avatar answered Sep 22 '22 13:09

Marc B