Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 07-13-2005, 02:55 AM   #1
LQ Newbie
Registered: Jun 2005
Posts: 17

Rep: Reputation: 0
editing a php.ini file

i received this error on an osCommerce installation in my new Virtual Private Server running Plesk 7.53 reloaded Linux / Unix.

FATAL ERROR: register_globals is disabled in php.ini, please enable it!

i have never ever edited a file directly on a webserver and need to:

i managed login via SSH and have reached the

[root@admin root]#

how do i proceed to find php.ini so that i can edit it?

once found how do i edit it?
Old 07-13-2005, 07:15 AM   #2
Senior Member
Registered: Jan 2002
Location: St Louis, MO
Distribution: Ubuntu
Posts: 1,284

Rep: Reputation: 47
The php.ini will usually be located within the /etc directory, but can then vary depending on the Linux distro running on it. Usually it's fairly easy, there will be a folder called php or php4 within /etc and then possibly another folder called apache within it. For example, on my Debian systems, I would:
cd /etc/php4/apache
and that's where php.ini is located. It may /etc/php/php.ini on your system, so have a look for a folder called php with /etc/ To change directory, you simply type
cd directoryname
Once you've found the file, there are few different editors you could use, of which 'vi' is most likely to work on all systems, so again, as an example:
vi /etc/php4/apache/php.ini
would let me edit the php.ini file on my system. There will be a line saying 'register_globals off' which you simply edit to say 'register_globals on'. It's usually disabled by default to prevent problems happening with your php code, and I'm surprised a pre-built solution needs it turning on.

Get back in touch if you'restill having problems.
Old 07-13-2005, 09:31 AM   #3
Registered: Apr 2002
Posts: 498

Rep: Reputation: 30
run the following
# echo '<? phpinfo(); ?>' | php | grep ini
to find the location of your php.ini file.
Old 07-13-2005, 11:37 AM   #4
Senior Member
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
Instead of enabling register_globals globally, enable it for the specific directory for that web application.

create an .htaccess file in the directory where you need register_globals and put this code in it:

# Override PHP settings. The first IfModule is
# for Apache 1.3, the second for Apache 2.
<IfModule mod_php4.c>
  php_value register_globals 1
<IfModule sapi_apache2.c>
  php_value register_globals 1
I have a complete register_globals howto posted on my web site at if you need more details.
Old 07-13-2005, 12:16 PM   #5
LQ Newbie
Registered: Jun 2005
Posts: 17

Original Poster
Rep: Reputation: 0
thank you that was very helpful


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
What to restart after editing php.ini? newlinuxnewbie Linux - General 4 10-08-2013 03:15 PM
Question about php.ini file. jon_k Linux - Software 0 08-07-2004 05:52 AM
PHP.ini Troubles on conf file Gerardoj Linux - General 3 03-24-2004 08:03 PM
php.ini and file uploads gblue Linux - Newbie 0 02-29-2004 05:28 PM
editing PHP.INI file question hct224 Linux - Newbie 1 10-31-2003 10:05 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:32 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration