Re: [PHP] phpinfo returns a permission error

2006-02-14 Thread Dave M G



So, what does this say:
$umask


It says:
0022


and this:
$ ls -l /home/dave/web_sites/phpinfo.php


It says:
-rw---  1 dave dave 20 2006-02-13 22:45 /home/dave/web_sites/phpinfo.php



and are you using the browser to view the file via
a server (e.g., the browser address bar says http://;),


Yes. I view it via localhost, within FireFox.


Is PHP running as mod_php in apache, or CGI?


I'm not sure. I don't know how to answer this.


Finally, can you view other files in the same directory
via similar means? 


Yes. I have three different web sites that I test here on my local 
machine, all of which use PHP extensively. In fact, exclusively. And 
they all execute and display PHP pages without any error. This 
phpinfo.php script is the first ever page that I've had any kind of 
issue with.


--
Dave M G

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] phpinfo returns a permission error

2006-02-14 Thread Kevin Kinsey

Dave M G wrote:


and this:
$ ls -l /home/dave/web_sites/phpinfo.php



It says:
-rw---  1 dave dave 20 2006-02-13 22:45 
/home/dave/web_sites/phpinfo.php




Well, I'd sure suspect this.  PHP/Apache are probably running as
nobody, daemon, www, or somesuch, and the permissions
on the file above only allow the user dave to read (and write to)
this file.

Try:

   $ chmod 644 /home/dave/web_sites/phpinfo.php

  and see if you can read the file.

In addition, do some checking on your umask, or
try and remember how you created this file.  A umask
of 22 should produce  -rw-r--r--:

[624] Tue 14.Feb.2006 16:15:58
[EMAIL PROTECTED]/daleco/software/Windows]
umask
22

[625] Tue 14.Feb.2006 16:17:00
[EMAIL PROTECTED]/daleco/software/Windows]
touch foobar  ls -l foobar
-rw-r--r--  1 kadmin  wheel  0 Feb 14 16:17 foobar

   but obviously, yours did not.

022 is the default umask for most shells.  Seems likely
that you were running your editor/IDE/whatnot setuid
root, perhaps?


HTH,

Kevin Kinsey

--
Don't hate yourself in the morning -- sleep till noon.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] phpinfo returns a permission error

2006-02-13 Thread Dave M G

PHP list,

   I wanted to adjust my register global settings in my php.ini file. I 
found instructions on this page:

   http://www.dmcinsights.com/phpmysql/phpini.php

   The first thing it says to do is take a look at the results of 
phpinfo(); to see where the php.ini file actually is.


   So I created a phpinfo.php file, put in the following code:
?php
phpinfo();
?
   ... and then accessed it through FireFox at localhost.

   To my surprise, I got the following error message:

Warning: Unknown(/home/dave/web_sites/phpinfo.php): failed to open 
stream: Permission denied in Unknown on line 0


Warning: (null)(): Failed opening '/home/dave/web_sites/phpinfo.php' for 
inclusion (include_path='.:/usr/share/php:/usr/share/pear') in Unknown 
on line 0


   It looks to be a permissions issue. But who has permission if not 
me, and how is permission an issue when I'm just looking at the file 
through a browser?


   By the way, I'm using PHP 4.4.0-3 on Ubuntu 5.10.

   Any advice or help would be much appreciated.

   Thank you.

--
Dave M G

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] phpinfo returns a permission error

2006-02-13 Thread Kevin Kinsey

Dave M G wrote:


PHP list,

   I wanted to adjust my register global settings in my
php.ini file. I found instructions on this page:
   http://www.dmcinsights.com/phpmysql/phpini.php

   The first thing it says to do is take a look at the
results of phpinfo(); to see where the php.ini file actually is.

   So I created a phpinfo.php file, put in the following code:
?php
phpinfo();
?
   ... and then accessed it through FireFox at localhost.

   To my surprise, I got the following error message:

Warning: Unknown(/home/dave/web_sites/phpinfo.php):
failed to open stream: Permission denied in Unknown on line 0

Warning: (null)(): Failed opening '/home/dave/web_sites/phpinfo.php'
for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in 
Unknown on line 0


   It looks to be a permissions issue. But who has permission if not me,
and how is permission an issue when I'm just looking at the file 
through a browser?


   By the way, I'm using PHP 4.4.0-3 on Ubuntu 5.10.

   Any advice or help would be much appreciated.

   Thank you.

--
Dave M G



So, what does this say:

$umask

and this:

$ ls -l /home/dave/web_sites/phpinfo.php

and are you using the browser to view the file via
a server (e.g., the browser address bar says http://;),
or via the filesystem (you've opened it from an explorer
type window and the address bar says file:///)

Is PHP running as mod_php in apache, or CGI?

Finally, can you view other files in the same directory
via similar means?

Kevin Kinsey

--
Stult's Report:
Our problems are mostly behind us.
What we have to do now is fight the solutions.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] phpinfo returns a permission error

2006-02-13 Thread Jay Blanchard
[snip]
I wanted to adjust my register global settings in my php.ini file. I 
found instructions on this page:
http://www.dmcinsights.com/phpmysql/phpini.php

The first thing it says to do is take a look at the results of 
phpinfo(); to see where the php.ini file actually is.

So I created a phpinfo.php file, put in the following code:
?php
phpinfo();
?
... and then accessed it through FireFox at localhost.

To my surprise, I got the following error message:

Warning: Unknown(/home/dave/web_sites/phpinfo.php): failed to open 
stream: Permission denied in Unknown on line 0

Warning: (null)(): Failed opening '/home/dave/web_sites/phpinfo.php' for 
inclusion (include_path='.:/usr/share/php:/usr/share/pear') in Unknown 
on line 0
[/snip]

Where did you put the phpinfo.php file after you created it? Did you try
accessing like this; http://127.0.0.1/phpinfo.php ?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php