|
|
|
|
|
|
c**t 发帖数: 2744 | 1 Running apache+php on Windows XP; gnu-Util installed but the following state
ment always failed when requesting via web browser; but can return correct f
iles when running from command line:
...
$files = explode("\n", `ls -c1 $path | tail -n$numb` );
...
I guess it's permission issue? can anyone help? | c*****t 发帖数: 1879 | 2 Sure sounds like it. Here are two things that you can do
1. Print $path, and `ls -c1 $path` before the line shown and
save the output to a file and see that is expected.
2. Generate the environement which is set up by the web server using
a simple shell script. Then launch your script within this
environment under the assumed id of the web server at command line
to debug.
state
f
【在 c**t 的大作中提到】 : Running apache+php on Windows XP; gnu-Util installed but the following state : ment always failed when requesting via web browser; but can return correct f : iles when running from command line: : ... : $files = explode("\n", `ls -c1 $path | tail -n$numb` ); : ... : I guess it's permission issue? can anyone help?
| q**1 发帖数: 193 | 3 your code should be working well as long as you issued an
absolute physical path to '$path'. under my apache2/php5/ubuntu
box, it can even grab files under /etc and post them to the web...
but WinXP might be different, duno, hehe.
state
f
【在 c**t 的大作中提到】 : Running apache+php on Windows XP; gnu-Util installed but the following state : ment always failed when requesting via web browser; but can return correct f : iles when running from command line: : ... : $files = explode("\n", `ls -c1 $path | tail -n$numb` ); : ... : I guess it's permission issue? can anyone help?
| c**t 发帖数: 2744 | 4 like is_writeable($file) always returns read-only on XP... I am using absolu
te physical path $_SERVER['DOCUMENT_ROOT'] . "/..."; also tried "\\...",
neither worked in browser..
【在 q**1 的大作中提到】 : your code should be working well as long as you issued an : absolute physical path to '$path'. under my apache2/php5/ubuntu : box, it can even grab files under /etc and post them to the web... : but WinXP might be different, duno, hehe. : : state : f
| q**1 发帖数: 193 | 5 can you print out this "$path" to the web and see if it prints
correctly? All my files under /etc are not writeable, and failed
with the is_writeable($file) test, but they can all be on the web
properly. BTW, is the $path from your URL?? like
http://example.com/path
only in this case, I think you need to prepend 'DOCUMENT_ROOT'
right?? :-)
absolu
,
【在 c**t 的大作中提到】 : like is_writeable($file) always returns read-only on XP... I am using absolu : te physical path $_SERVER['DOCUMENT_ROOT'] . "/..."; also tried "\\...", : neither worked in browser..
|
|
|
|
|
|
|