R08 Posted November 30, 2005 Share Posted November 30, 2005 Hi, I've been working on my site for around 5 months now on my local machine running Apache/MySQL etc with no problems whatsoever. I've made huge numbers of edits to the php code, added and removed fields from the database etc... I've uploaded my files to the host and copied my database without event thanks to some help from Vger. When I try to access index.php I get the following error: * FATAL ERROR: register_globals is disabled in php.ini, please enable it! I've searched the forum and have found multiple patches to deal with this issue before or immediately after installation by replacing files. I cannot replace files, my 5 months of hard work mean too much to me to just start again with a blank install. I'm on a shared server and my host will not enable register_globals for me. Is there a way around this, or would somebody be willing to point me in the direction of what code I need to change to make the site work without register_globals. Any help with this would be massively appreciated as I really want to get my site live as soon as possible. Thanks in advance, Rob. Link to comment Share on other sites More sharing options...
Guest Posted November 30, 2005 Share Posted November 30, 2005 Search the contributions, i believe there is a contrib that helps with this. HTH Giovanna Link to comment Share on other sites More sharing options...
azimpact Posted November 30, 2005 Share Posted November 30, 2005 I ran into the same thing so I over wrote their settings and put php.ini in my own directory. First, you have to grab a copy of their PHP.INI. Create a PHP file and insert the following code into it: <?php // full unix path - location of the default php.ini file at your host $defaultPath = '/usr/local/lib/php.ini'; // full unix path - location where you want your custom php.ini file $customPath = "/home/user/public_html/php.ini"; if (file_exists($defaultPath)) { $contents = file_get_contents($defaultPath); $contents .= "\n\n; USER MODIFIED PARAMETERS FOLLOW\n\n"; // comment line $contents .= "register_globals = On \n"; // register globals On $handle = fopen($customPath, 'w'); if (fwrite($handle, $contents)) { if (file_exists($customPath)) chmod($customPath,0600); $message = "The php.ini file has been modified and copied"; } else { $message = "Processing error - php.ini write failed"; } fclose($handle); } else { $message = "Processing error - php.ini file not found"; } echo $message; ?> You will need to change the paths to relect your server and be sure to change user to your account name on the server. Once you have the file created, load it to your server root and run it. Once you have the file in your root directory, you then need to call it. Create a file and name it myphpini.cgi. Put the following code into that file: #!/bin/sh HOME=/home/`whoami` export PHPRC="${HTTP_PHPRC:-$HOME}" export SCRIPT_NAME=$REQUEST_URI export SCRIPT_FILENAME=$PATH_TRANSLATED exec /usr/bin/php Save the file and load it to root directory where the php.ini is. CHMOD the file to 755. Ok, now you need to tell the server to use it instead of the server file by adding the following lines to the top of your .htaccess file: Add to .htaccess: Action my-php-ini /myphpini.cgi AddHandler my-php-ini .php That should do the trick as long as they don't have something on the main server that prevents you from doing this. I've used this method on several sites. Link to comment Share on other sites More sharing options...
snadowitz Posted November 30, 2005 Share Posted November 30, 2005 OP - any chance of telling me how you got mysql to work? I get an error that says:- Client does not support authentication protocol requested by server; consider upgrading MySQL client My projects:- http://www.starcrossedtattoo.com - Great Art http://www.thetaxback.co.uk - UK Tax Advice Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.