PHP GD library installed but not working on CentOS 6.4

I installed php 5.5.6 from remi repo, bun phpinfo() does not show that the GD library and the gd_info() function gd_info() not exist.

The extension is included in /etc/php.d/gd.ini , but still nothing.

I also tried reinstalling the php-gd library and reinstalling it successfully, but everything remained as it was before.

 yum --enablerepo=remi,remi-php55 reinstall php-gd Loaded plugins: fastestmirror Setting up Reinstall Process Loading mirror speeds from cached hostfile * base: mirrors.supportex.net * epel: mirror.muntinternet.net * extras: mirrors.supportex.net * remi: mirror.1000mbps.com * remi-php55: mirror.1000mbps.com * rpmforge: mirror.nl.leaseweb.net * updates: mirror.muntinternet.net Resolving Dependencies --> Running transaction check ---> Package php-gd.x86_64 0:5.5.6-1.el6.remi will be reinstalled --> Finished Dependency Resolution Dependencies Resolved ==================================================================================================================================== Package Arch Version Repository Size ==================================================================================================================================== Reinstalling: php-gd x86_64 5.5.6-1.el6.remi remi-php55 66 k Transaction Summary ==================================================================================================================================== Reinstall 1 Package(s) Total download size: 66 k Installed size: 228 k Is this ok [y/N]: y Downloading Packages: php-gd-5.5.6-1.el6.remi.x86_64.rpm | 66 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : php-gd-5.5.6-1.el6.remi.x86_64 1/1 Verifying : php-gd-5.5.6-1.el6.remi.x86_64 1/1 Installed: php-gd.x86_64 0:5.5.6-1.el6.remi Complete! 

After that, I restarted the server, but did not change anything.

The extension is still included in the gd.ini file.

The gd.so file exists in /usr/lib64/php/modules .

But there is one big problem (I think this is the reason): when I run php scripts from the console, I get a warning:

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/gd.so' - libvpx.so.0: cannot map zero-fill pages: Cannot allocate memory in Unknown on line 0

Than I tried to reinstall libvpx , restarted the server and again without changes: the same warning php unable to load library ....

Please help - this problem is driving me crazy :(

+5
php centos6 php-gd
Nov 28 '13 at 9:24
source share
1 answer

After a long search on the Internet (I made many attempts in the past days, but the latter was successful), I found a solution, and it was not connected with GD, PHP or any of its libraries.

My VPS has 1 GB or RAM, 450 MB for free. But it turned out that memory is not the only thing that requires GD :) He wanted a SWAP file!

I followed these instructions - How to add swap on CentOS 6 and added a 1GB SWAP file. After switching on - everything began to function! And no more unpleasant mistakes :)

+6
Nov 28 '13 at 21:54
source share



All Articles