Help - Search - Members - Calendar
Full Version: Php.ini
The Planet Forums > Control Panels > Plesk > Plesk HOWTOs
Power-J
Hi guys,

I'm in search of a PHP guru to help me with a problem. Here it is: I have a particular script that will not run on my server, but will on another server hosted elsewhere. I've looked at my php.ini file, but I can't get the other host php.ini file, the only thing I can get is the output of phpinfo.php - Is there a way that I can modify my php.ini based on the other server host's phpinfo.php details? If so, what's the easiest way to do so? I'v tried going line by line and it looks like it will take me forever trying to find the variables from my php.ini file, then go to the browser for the phpinfo.php output. I hope I'm not confusing anyone with my question.

Bottom line is on my server I install the script as per the instructions, but whenever I click on any link such as (registration, login, etc) nothing happens. It look as if the no matter what I click on, the script remains on the index.php file. I've checked the requirements (PHP 4 and MySQL 4) which match my server, still it does not work. I don't know what to do at this point and don't wanna have to pay a virtual host service provider just to host that script when I have my own server to do so.

So, please any input will be greatly appreciated.

Thanks !!
Squire
Hard to say without knowing what you're trying to run Power-J, but if I had to guess the other server has some module installed that you don't. Or the script requires Globals=Off or Safe-Mode turned off or something.

You can try to check in your /home/httpd/vhosts/domain.com/statistics/logs/error_log file. It might yield you some clues as most recent PHP builds will write errors to that instead of to the page. Or you can change the error/notice notification on the script so that it shows on the page for you. If it's a globals problem or safe-mode problem it should show up in there for you with a standarad php install.

Otherwise, you could always use the configure line that shows at the very top of your phpinfo(); page to duplicate what's on the other server. But that could mean installing additional modules and compiling from scratch. It's not necessarily the easiest way to do things if you never have before. But it does give you a bit more control.

Bottom line is that you need to determine what the error is first. Then the solution will likely be pretty obvious.
Power-J
Thanks Squire. I wonder if I can post both phpinfo.php files on here (Of course I would remove any IP address, Host and Server Name from the files). That way you folks can help me tweak mine to match theirs. Thanks !!
Power-J
I was trying to post both PHPINFO.PHP here, but text is too long. I've pasted both onto notepad, and attached it to this post. I've labeled the Subject Server as the server I wanna match my php.ini configurations too. Any help will greatly be appreciated. Thanks !!
Squire
Looks like a pretty standard setup for you PHP installation Power-J. The other server has a few modules installed that your new one doesn't have, but unless the script specifically requires those that shouldn't be the issue. Do the docs on your script say that it requires any special PHP modules?

If I had to take a wild stab I would first guess that it may be a safe-mode issue. The old server has that disabled (see '--enable-safe-mode=no' in its config commands) and your server has it enabled by default. (see '--enable-safe-mode' in the config) Frankly, the second option is the better choice for server-wide settings. Mine are set up with safe-mode On, then I can disable it if need be for the individual domains that need it for one reason or another. register_globals is also different on each server.

I would try tweaking safe_mode and open_base restrictions for the individual domain first to see if it gets your script working. To do that log in via SSH to your server and cd over to /home/httpd/vhosts/yourdomain.com/conf (I'm assuming you're on a *nix/Plesk system here.)

Then create a vhost.conf file (probably nano -w vhost.conf) and insert the following, replacing "yourdomain.com" with your actual domain.

CODE
<Directory /home/httpd/vhosts/yourdomain.com/httpdocs>

php_admin_value safe_mode 0

php_admin_value open_basedir /home/httpd/vhosts/yourdomain.com

php_admin_value upload_tmp_dir /tmp

</Directory>


After that you'll want to reload the domain so that the vhost.conf changes are registered. That one would be /usr/local/psa/admin/sbin/websrvmng -a -v to have PSA reload all of the domains, of /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=yourdomain.com to have just one domain reconfiged. Some suggest restarting apache to (sevice httpd restart) too, but I rarely bother.

See if that doesn't fix the problem.

In case it doesn't, you can also tweak the register_globals settings too. You can do that in the vhost.conf, or if you want to see an immediate change without having to reload the configurations you can simply create a .htaccess file inside the httpdocs root level for the domain in question and include the following line:

CODE
php_value register_globals 1


One or both of the above should fix things. If it doesn't, then we'll need to get some more info on the script, because that would indicate that it needs one of those special modules the other server has installed in order to work properly.
Power-J
Thanks Squire. I will execute your suggestions. Meanwhile, I wanted to post the Script's Server Requirement for you to take a look and see if mine matches it.

=================================
Server requirements
=================================
1.) MySQL (version 4 or higher)
2.) MYSQL database
3.) PHP (version 4.2.3 or higher)
4.) GD library for PHP with GIF support
5.) ImageMagick (optional)

One question, how do I got about installing the modules listed on the other server on mine? I'm running nix/Plesk 7.5 RHEL3.
Power-J
Squire, you're the man! I've tried your suggestions and the second part work. It was the register globals settings. THANK YOU SO VERY MUCH. I've been trying to get this script to work for so long. It now works and I owe it all to you. If you ever need anything that I can help with, please do not hesitate to call on me.

Thank you !!!
Squire
My pleasure. Glad to be of help.

As to your earlier question, you may or may not have all of that already installed. MySQL4 is the main one since I don't believe that particular version has been pre-packaged with any Plesk releases yet. There are some posts around here about how to do that. The PHP version should be no problem. The GD Library is listed in your phpinfo, so that's there.

ImageMagick you would need to check via SSH. It doesn't show up on phpinfo. Assuming it was probably installed via RPM you should be able to find it with a rpm -qa ImageMagick to get the version number and such. Or you can usually find traces of it in /usr/share/ if it's installed on the server by RPM or compiled.

FWIW, even though ImageMagick is optional in your script, I'm a big fan. If you're doing anything with images the power of ImageMagick and the image quality it offers is far better than what you'll get from GD.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.