php gd lib is installed but not working - gd

On the localhost the library is working fine, when the function is called on production,php throws a fatal errer.
i checked the phpinfo() its there and it is enabled.
I tired to see if there is anything that i can add on the php.ini but i couldn't find any.
The error is thrown when i call
gd_info();
Is there anything that i can add on the php.ini file that can solve this problem, or is there another library for gd?
The error am getting is the following
Fatal error: Call to undefined function gd_info(

It may be a little bit late, but I hope it helps anyone.
I had the same problem when I tried to run GD over apache.
The problem was in php.ini path for apache. By default it is not using php.ini from php directory.
You need to define PHPIniDir in httpd file or place copy of php.ini to apache folder.
To check if it is your case you can compare output of php --ini from php folder and output of phpinfo() over apache. If it is showing different php.ini destinations you need to fix it.

I had exactly the same problem
although I had installed it using apt-get install php7.0-gd that function was undefined, so I inspected php.ini file in /etc/php/7.0/apache2/php.ini
turned out that the line for gd extension was commented!
so I removed semicolon before the line and it was working!
so crazy wasted an half an hour of mine :D

Related

Installing YAML for PHP in IIS

I am trying to install the YAML 1.2 extension to PHP 5.6 under IIS 10 (Windows 10). I am using http://pecl.php.net/package/yaml/1.2.0/windows to download the files.
I have downloaded the PHP 5.6 non-thread-safe DLL (x86 to match my version of PHP), copied php_yaml.dll to my extension directory, copied yaml.dll to C:\Windows\System32 (which is reported as one of the paths in phpinfo()) and added extension=php_yaml.dll to my php.ini. I've verified with phpinfo() that the correct php.ini file is being loaded, and commenting out other extensions removes them from the output of phpinfo().
However, YAML doesn't appear in the output of phpinfo() and the functions are not loaded. Running php-cgi.exe -v from the command line gives a warning:
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\PHP\php_5_06_14\ext\php_yaml.dll' - The specified module could not be found.
in Unknown on line 0
The file exists at the location specified and the permissions appear to be correct. What else can I do to get it working?
As far as I can tell, the use of PECL as package manager is being in dropping.
Having to install extensions in a server makes things more complicated and it depends on the environment, permissions, etc.
I'm sure someone could help you solve that (I haven't work on windows in years, so I can't)
But, instead I suggest you another solution. Maybe you can opt for it, maybe you have to stick with the extension, but, in case you can actually look for other option, I suggest you to use another library.
https://github.com/symfony/yaml
And, you could use Composer to install your libraries, I suggest you take a look at it.
Again, it may be for you or not, but I think this would be a lot easier.
I hope that helps.
I put the path to my extension directory in the path environment variable. That fixed the issue for me.

Composer fails installing laraveldaily/quickadmin

While intstalling laraveldaily/quickadmin I got the following error.
Please help me to solve my problem.
As you can read in the error message
intervetion/image requires ext-fileinfo
You need to enable ext-fileinfo by editing your php.ini and change the following line by removing the ; at the beginning.
From:
;extension=php_fileinfo.dll
To:
extension=php_fileinfo.dll
Find out which php.ini to edit
Run php --ini from a terminal. Make sure you run this command from terminal as the CLI version of PHP may have loaded another php.ini than the web version. Your phpinfo() may not contain the correct path.
As error describes, laraveldaily/quickadmin requires intervention/image which again requires ext-fileinfo. This library is maintained by php_fileinfo.dll
php_fileinfo.dll is a dll(library file) which contains modules to guess the content type and encoding of a file by looking for certain magic byte sequences at specific positions within the file.
To fix this error first go to the directory of your php installation.Go to the ext folder and make sure that php_fileinfo.dll is present.
Now open your php.ini file (To locate that, type php --ini on the command line, also suggested by #peh) .
In the php --ini file just add the following line.
extension=php_fileinfo.dll
and recheck with the composer.

PHPUnit setup with Zend 1.12.3

I am just getting start with Zend Framework and seem to run into this problem
Testing Note: PHPUnit was not found in your include_path, therefore no
testing actions will be created.
I am on mac 10.8.5, Using Zend Server 6 (free), and Zend Framework 1.12.3
Have pear and phpunit installed
which pear
/usr/local/zend/bin/pear
which phpunit
/usr/local/zend/bin/phpunit
from php info and include_path
Loaded Configuration File /usr/local/zend/etc/php.ini
include_path=".:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/bin/pear:/usr/local/zend/bin/phpunit:/usr/local/zend/share/pear:/usr/local/zend/share/pear/phpunit"
No matter what i put in the include_path, i always get the above notice, PHPUnit was not found in your include path.
I been searching and someone said zf.ini can cause this, and that file should be editted, however i can't seem to find such a file anywhere on my Mac. I do have previous Mamp and Xampp installations, but phpinfo() states the correct php.ini file loaded so i doubt that is the problem
Edit:
Okay so i finally managed to fix it. Using "zf.sh --setup" i found the paths to all the config files, including .zf.ini and how to edit it. The file did not exist, so i had to create it, and adding "include_path" to .zf.ini fixed the issue. However in the end i am overriding the php.ini which was probably being over ridden. I still like to know why adding pear path to php.ini didn't work, hopefully someone can explain that

PHP extension “mcrypt” must be loaded.

I am installing magento CMS, and am trying to install the files. I am getting this error when I am in configuration mode.
PHP extension “mcrypt” must be loaded.
I am used to activating this extension by removing ; from extension=php_mcrypt.dll in php.in, but the problem is still present.
Why would this be happening and how do I fix this problem?
I recommend to restart the web server.
Run php file with
<?php
phpinfo();
and check whether there is a mcrypt extension, if no check path for right php.ini file.

PHP extension "curl" must be loaded

I'm trying to install a Magento on my server, and when I get to "Configuration", the installation launches:
PHP extension "curl" must be loaded.
I've checked my php.ini, and extension=php_curl.dll is not commented. For both Apache and PHP folders. I also checked my Wamp manager, and it looks like this:
.
So I guess that my php_curl is working fine... But I still get the same message when I install Magento:
.
Any idea on what's wrong?
I had the same problem. The mod_curl extension in wamp has a bug.
You can replace it with a newer version. I don't know which PHP-Version you use but here you can download a newer version. Download a TS (TheadSafe) version of the module and replace it with your existing curl module.
http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/
And a helpfull post:
http://forum.wampserver.com/read.php?2,85716
Replaced the old php_curl.dll with the new one in \wamp\bin\php\php5.4.3\ext\ by downloading from http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/ .
Now its working. It is the error with recent wamp installation package.
You have to modify the php.ini files in your xampp folder. Three files in three different places need to be changed.
Follow the following steps to enable curl library with XAMPP in Windows:
Step 1:
Browse and open the following 3 files
C:\Program Files\xampp\apache\bin\php.ini
C:\Program Files\xampp\php\php.ini
C:\Program Files\xampp\php\php4\php.ini
Step 2:
Uncomment the following line in your php.ini file by removing the semicolon (;).
;extension=php_curl.dll
After that it will look something like something below-
extension=php_curl.dll
Step 3:
Restart your Apache server.
Step 4:
Check your phpinfo() to see whether curl has properly enabled or not.
Enjoy using curl() library.

Resources