Changes I make to local php.ini files aren’t showing up.
These are changes in the homes/myserver.com/etc/php.ini file. I then use ‘service httpd restart’ (and have even done complete reboot of the machine) but the changes don’t take effect when I uses a phpinfo() request on a webpage (using CTRL-F5 to make sure it reloads the page)
What you’re describing can occur if the Virtual Server is setup to use mod_php rather than CGI or FCGID. Only CGI and FCGID offer per-domain php.ini files, mod_php uses one central php.ini file.
To determine which you’re using, you can go into Server Configuration -> Website Options, and look at the “PHP Execution Mode”.
Thanks Eric. Changing from mod_php worked and the phpinfo() showed the updated changes but now I’m getting strange errors like “Fatal error: Call to undefined function mysql_pconnect() in /home/…”
How does changing from mod_php to CGI or FCGID (not sure what they stand for or why I would use one or the other but…) How does the cahnge affect functions like this?
That just means that the way your system is setup, that the “MySQL” module isn’t being loaded in those other two modes.
I do suggest using CGI or FCGID, as they’re more secure, as well as being more flexible.
But you may need to make sure that the PHP5 MySQL module is installed and enabled.
If that website were previously setup to use PHP4, it’s possible that the php.ini file has something in it that’s preventing the MySQL module from being loaded.
You’d either need to troubleshoot your domain’s php.ini file (my hunch is that it may have an incorrect extension_dir – you could try commenting that out entirely) – or you could simply copy over a new version of it from /etc/php.ini.
Apparently, this function is only designed to work with mod_php – it won’t work with PHP’s CGI or FCGID modes.
So, in order to use the web application you have as it’s currently written – you’d have to use mod_php. That prevents you from being able to make changes to the php.ini file in $HOME/etc/php.ini (well, you can make changes, but they won’t be seen).
You can, however, make changes to the global php.ini file in /etc.
Thanks for the links and the info. Based on some reading I decided to go for FastCGI instead and rewrite the code (just an include anyway) to use mysql_connect instead of pconnect but it still comes back with an error…
Fatal error: Call to undefined function mysql_connect() in /home/blahblah.com/public_html/Connections/aasts_aasts.php on line 9
I installed virtualmin on a clean centos5 machine when I built this. Is this something I have to enable? Can you help me out with this? I wonder why it’s not enabled by default on the install?
It looks like you do indeed have the PHP MySQL module installed. So I’m not quite sure what is wrong, most folks are able to begin using PHP and MySQL out of the box
Is it possible you could post a link to a script running on your server that outputs “phpinfo()”?
Or, you could always attach your Virtual Server’s php.ini file (in $HOME/etc/php.ini), that may contain some clues as to what’s going on.
Ok, here’s a sanitized dump of the phpinfo() [html, sorry] and php.ini …
OK, well that’s not working. I tried to upload a pdf of the dump using both Firefox and IE and I got the same error: “An HTTP error 0 occurred. /comment-upload/js”
So if you rename info.txt to info.html and open it in a browser, you will get the phpinfo() dump and the phpini.txt is the php.ini (again, sanitized)
Thanks Eric, that fixed it but I still can’t see how it got set unless it was by Centos installer or virtualmin installer.
BTW there are modules in /usr/lib/php/modules and the main /etc/php.ini looks to that dir so I can’t see how that got changed in the local homes one unless virtualmin did it during setup.
I have same problem as above , means changes I make to local php.ini files aren’t reflecting.I have also go through above solution but my problem is that from where i can set mod_php value. Do i set in php.ini file and do i need to install mod_php module