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 - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 06-22-2006, 10:30 PM   #1
Tim_Olaguna
Member
 
Registered: Dec 2005
Location: Sacramento, CA, USA
Distribution: Fedora 5
Posts: 36

Rep: Reputation: 15
Question user_dir Setting Format In php.ini


Does anybody know the correct format for setting the user_dir variable in php.ini?

Is it:
user_dir = public_html
user_dir = "public_html"
or something else?

After creating a file in my server's document root called phpinfo.php, I get a nice print out of my php settings. That print out shows user_dir as set as public_html no matter which of the two above options I have chosen (yes, I have rebooted or stopped and restarted the apache serrver many times).

My problem is:
When I access http://localhost/phpinfo.php in my browser I get the print out I expect.
BUT!
When I copy that same phpinfo.php file to /home/(username)/public_html/ , set all of the required permissions, then try to access http://localhost/~username/phpinfo.php I get the evilly inspired and totally unhelpfful cryptic "Forbidden. You don't have permission to access /~username/phpinfo.php on this server." Despite the fact it's my file, my directory, my Linux install, my cotton-pickin computer, and my house!!

I'm running Fedora 5 Linux on an HP PC with lot's of speed, disk space, and RAM. Apache 2 and php 5. I searched extensively but, while I find lots of links telling me I can or don't have to set user_dir, I cannot find any clear examples of what works and what does not. This setting is usually just briefly mentioned as one amongst a long list of other possible settings. A lengthy description of how to use this setting (including samples) does not appear to exist.
 
Old 06-23-2006, 02:22 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Quote:
Despite the fact it's my file, my directory, my Linux install, my cotton-pickin computer, and my house!!
Right. But apache isn't running as 'you', it is running as 'apache' or perhaps 'nobody' and therefore has 'nobody's permissions. This means the server cannot enter your home directory to serve the files. To fix this you need to "chmod o+x /home/(username)", "chmod o+x /home/(username)/public_html/" and finally, all the actual files inside /home/(username)/public_html/ will need to be world readable.
 
Old 06-24-2006, 02:53 PM   #3
Tim_Olaguna
Member
 
Registered: Dec 2005
Location: Sacramento, CA, USA
Distribution: Fedora 5
Posts: 36

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bulliver
Right. But apache isn't running as 'you', it is running as 'apache' or perhaps 'nobody' and therefore has 'nobody's permissions. This means the server cannot enter your home directory to serve the files. To fix this you need to "chmod o+x /home/(username)", "chmod o+x /home/(username)/public_html/" and finally, all the actual files inside /home/(username)/public_html/ will need to be world readable.

bulliver --

HA! Now, of course, it works. Thank you for reminding me of some of the basics. I really appreciate your time and effort.
 
Old 06-24-2006, 02:58 PM   #4
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
No problem Tim, glad you got it sorted.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
php.ini-dist to php.ini lord-fu Programming 10 05-02-2006 05:24 PM
php5 apache2 mysql4 don't work, php does not seem to read php.ini atom Linux - Software 5 03-24-2005 11:05 AM
Upgraded PHP from 4.3.4 to 4.3.10 and now it won't read php.ini gregmcavoy Linux - Software 11 01-22-2005 12:16 PM
php: different mail server from php.ini rayds Programming 0 09-14-2004 03:48 AM
convert windows' cdplayer.ini to linux format? SharpyWarpy Linux - General 2 04-26-2004 07:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 05:25 AM.

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