LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-13-2005, 02:55 AM   #1
ilustrate
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
fouldsy
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:
Code:
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
Code:
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:
Code:
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
TruckStuff
Member
 
Registered: Apr 2002
Posts: 498

Rep: Reputation: 30
run the following
Code:
# echo '<? phpinfo(); ?>' | php | grep ini
to find the location of your php.ini file.
 
Old 07-13-2005, 11:37 AM   #4
KimVette
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:

Code:
# 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>
<IfModule sapi_apache2.c>
  php_value register_globals 1
</IfModule>
I have a complete register_globals howto posted on my web site at http://kim.biyn.com/Linux/enabling_r...r_virtual_host if you need more details.
 
Old 07-13-2005, 12:16 PM   #5
ilustrate
LQ Newbie
 
Registered: Jun 2005
Posts: 17

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:43 PM.

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