PHP GD

Hi guys,

I’m not sure if this is normal behavior, I’m pretty new to Virtualmin, but when I’m creating a new virtual server I get a new php.ini file in the directory of the new virtual server. Etc. /home/virtualserver/etc/php5/php.ini

I am trying to get PHP GD running on my system. I have installed it and it should be working fine, but when I am trying to execute a GD function on the new virtual server, it’s not working. I also cannot find information about GD in phpinfo() if I run that.

Yet, if I run yum install php-gd on my server, it tells me it’s already installed.

Any ideas?

Thanks!

Howdy,

Yeah, when using FCGID or CGI as the PHP Execution Mode (which is the default), each individual Virtual Server would get it’s own php.ini file.

That’s because FCGID and CGI are setup so that PHP scripts are run as the Virtual Server owner, which is a security benefit.

Using mod_php, it would use the system-wide php.ini file.

However, normally, installing the php-gd module would make that available to all your domains.

You may want to take a look in “/etc/php.d/”, and make sure you see a file named “gd.ini” that contains a line like this:

extension=gd.so

Although your various Virtual Servers have their own php.ini file, they would still look in /etc/php.d.

-Eric

Hi Eric,

Thanks for the reply.

Yes in /etc/php.d/ there is a file called gd.ini which contains the line you mention.

I think I’ve now broken something. I decided to remove httpd and php then reinstall it, but I think this has broken Virtualmin now. Whilst it is still running and showing my virtual servers, they are no longer working when I visit the URL’s. I’m guessing it’s because the httpd.conf will have been restored to default, do you know how I can restore this?

Thanks

Howdy,

What happens if you add “extension=gd.so” into the individual php.ini file located in $HOME/etc/php.ini?

If that doesn’t work – are you seeing any errors or warnings in $HOME/logs/error_log?

-Eric