Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread Ashley Sheridan
On Mon, 2009-08-17 at 20:16 +0530, kranthi wrote: > >> That's a potential security flaw waiting to happen. A script like this > >> shouldn't be kept in a web-accessible directory. > /var/www is not the document root. document root is /var/www/html so I > dont think there's a problem. > > >> /var/w

Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread kranthi
>> That's a potential security flaw waiting to happen. A script like this >> shouldn't be kept in a web-accessible directory. /var/www is not the document root. document root is /var/www/html so I dont think there's a problem. >> /var/www (usually your server root) I am mistaken regarding this. f

Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread Dotan Cohen
> Just out of curiosity, have you been able to run even the most basic of > scripts from PHP, like a plain old BASH 'echo' statement or something? I > only ask, because sometimes within the shell scripts themselves are > calls to other command line programs (even something as simple as 'ls') > whic

Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread Ashley Sheridan
On Mon, 2009-08-17 at 17:01 +0300, Dotan Cohen wrote: > > Did you check SELinux options ?? > > > > I do not have root access to that server. > > > I have a similar problem. For some unknown reason scan_dir() is not > > able to read /home/user when run as Apache module. but the CLI is > > giving e

Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread Dotan Cohen
> That's a potential security flaw waiting to happen. A script like this > shouldn't be kept in a web-accessible directory. > Thanks, Ash. That directory is HTTP-password protected. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread Dotan Cohen
> Did you check SELinux options ?? > I do not have root access to that server. > I have a similar problem. For some unknown reason scan_dir() is not > able to read /home/user when run as Apache module. but the CLI is > giving expected results. I did not find any work around, but had to > read /va

Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread Ashley Sheridan
On Mon, 2009-08-17 at 19:23 +0530, kranthi wrote: > Did you check SELinux options ?? > > I have a similar problem. For some unknown reason scan_dir() is not > able to read /home/user when run as Apache module. but the CLI is > giving expected results. I did not find any work around, but had to > r

Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread kranthi
Did you check SELinux options ?? I have a similar problem. For some unknown reason scan_dir() is not able to read /home/user when run as Apache module. but the CLI is giving expected results. I did not find any work around, but had to read /var/www which is the home directory of 'apache' (this is

Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread Dotan Cohen
> see if can run the same php file via CLI. does script.sh run without > any problems ? then, probably something linke SELinux is preventing > httpd from running scripts. you have to contact your system > administrator to get this fixed. > You are right. Running the php script from the CLI in an S

Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread kranthi
see if can run the same php file via CLI. does script.sh run without any problems ? then, probably something linke SELinux is preventing httpd from running scripts. you have to contact your system administrator to get this fixed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, v

Re: [PHP] Cannot exec in my own directory

2009-08-16 Thread Dotan Cohen
> Please copy your script in the Linux include paths. Such as /usr/local/bin > and give it neccecary permission and try your script again. > I do not have root access on this machine. That is why I run the script from /home/username/ -- Dotan Cohen http://what-is-what.com http://gibberish.co.il

RE: [PHP] Cannot exec in my own directory

2009-08-16 Thread Caner Bulut
. Thanks -Original Message- From: Dotan Cohen [mailto:dotanco...@gmail.com] Sent: Sunday, August 16, 2009 9:46 PM To: Sudheer Satyanarayana Cc: php-general. Subject: Re: [PHP] Cannot exec in my own directory > Check the include path. Try using the complete path to the file. And m

Re: [PHP] Cannot exec in my own directory

2009-08-16 Thread Dotan Cohen
> Check the include path. Try using the complete path to the file. And make > sure the user PHP is running has read permissions to the directories upwards > the hierarchy. > Thanks. I am using the complete path to the script: exec("/home/username/script.sh"); In the /home/username/ directory ther

Re: [PHP] Cannot exec in my own directory

2009-08-16 Thread Sudheer Satyanarayana
Dotan Cohen wrote: I have a script in /home/username/script.sh with permissions 777. I can SSH into the server and execute ./script.sh to run the script, but calling it from exec in PHP does not run it. What should I start checking? Thanks. Check the include path. Try using the complete path

[PHP] Cannot exec in my own directory

2009-08-16 Thread Dotan Cohen
I have a script in /home/username/script.sh with permissions 777. I can SSH into the server and execute ./script.sh to run the script, but calling it from exec in PHP does not run it. What should I start checking? Thanks. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP Ge