RE: [PHP] shell_exec question - Solved
To all who contributed to this thread, many thanks... I tried all the suggestions offered but still had the same problem. Today I copied php.ini-dist over to /etc, restarted Apache and everything works. This process was repeated many times during the last day or so, so I don`t know what happened to make it work this time. Anyhowze, my shell_exec`s are working now, so I`m a happy camper... Thanks again to all who assisted, muchly apreciated. -- Chris Blake Support Consultant Office : (011) 782-0840 Fax: (011) 782-0841 Mobile : 083 985 0379 Website: http://www.pbpc.co.za THE LESSER-KNOWN PROGRAMMING LANGUAGES #10: SIMPLE SIMPLE is an acronym for Sheer Idiot's Monopurpose Programming Language Environment. This language, developed at the Hanover College for Technological Misfits, was designed to make it impossible to write code with errors in it. The statements are, therefore, confined to BEGIN, END and STOP. No matter how you arrange the statements, you can't make a syntax error. Programs written in SIMPLE do nothing useful. Thus they achieve the results of programs written in other languages without the tedious, frustrating process of testing and debugging. 10:29:53 up 22 days, 1:59, 3 users, load average: 0.52, 0.19, 0.13 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] shell_exec question
Greetings learned PHP(eople); I`m using a shell_exec to get a list of files from a specified directory. When I run it locally on my machine i works. When I run it on the other machine I get = Warning: shell_exec() [function.shell-exec]: Cannot execute using backquotes in Safe Mode in /var/www/html/search.php on line 9 = In /etc/php.ini Safe Mode is offI read some postings in the archives and on the advice given checked that the owner of the script has the relevant permissions on the directory/files trying to be accessed, and they are the same i.e. root Any ideas ? -- Chris Blake Support Consultant Office : (011) 782-0840 Fax: (011) 782-0841 Mobile : 083 985 0379 Website: http://www.pbpc.co.za What does education often do? It makes a straight cut ditch of a free meandering brook. -- Henry David Thoreau 13:10:21 up 21 days, 4:40, 3 users, load average: 0.48, 0.33, 0.28 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec question
safe mode is on, turn it off and restart webserver. Then you can check directory permissions. Chris Blake wrote: Greetings learned PHP(eople); I`m using a shell_exec to get a list of files from a specified directory. When I run it locally on my machine i works. When I run it on the other machine I get = Warning: shell_exec() [function.shell-exec]: Cannot execute using backquotes in Safe Mode in /var/www/html/search.php on line 9 = In /etc/php.ini Safe Mode is offI read some postings in the archives and on the advice given checked that the owner of the script has the relevant permissions on the directory/files trying to be accessed, and they are the same i.e. root Any ideas ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec question
On 08 Oct 2003 13:25:51 +0200, you wrote: I`m using a shell_exec to get a list of files from a specified directory. When I run it locally on my machine i works. When I run it on the other machine I get What Marek said. However, is there any reason you're not using readdir()? http://uk.php.net/manual/en/function.readdir.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec question
On Wed, 2003-10-08 at 13:56, David Otton wrote: However, is there any reason you're not using readdir()? http://uk.php.net/manual/en/function.readdir.php I`ve got a whole bunch of other stuff happening using shell_exec, eg file searches etc I changed php.ini entry for safemode=on , restarted Apache, but that didn`t help.opendir() returns the following : = Warning: opendir() [function.opendir]: SAFE MODE Restriction in effect. The script whose uid is 0 is not allowed to access /home owned by uid 0 in /var/www/html/backups.php on line 8 Warning: opendir(/home/chris/PBPCBackup/) [function.opendir]: failed to open dir: No such file or directory in /var/www/html/backups.php on line 8 = I got this error as well prior to changing the safe mode parameter... Still lost, but searching :( -- Chris Blake Support Consultant Office : (011) 782-0840 Fax: (011) 782-0841 Mobile : 083 985 0379 Website: http://www.pbpc.co.za Women want their men to be cops. They want you to punish them and tell them what the limits are. The only thing that women hate worse from a man than being slapped is when you get on your knees and say you're sorry. -- Mort Sahl 14:40:40 up 21 days, 6:10, 3 users, load average: 0.32, 0.14, 0.25 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec question
Did you edit the right php.ini? Check out phpinfo() output for Configuration File (php.ini) Path Chris Blake wrote: On Wed, 2003-10-08 at 13:56, David Otton wrote: However, is there any reason you're not using readdir()? http://uk.php.net/manual/en/function.readdir.php I`ve got a whole bunch of other stuff happening using shell_exec, eg file searches etc I changed php.ini entry for safemode=on , restarted Apache, but that didn`t help.opendir() returns the following : = Warning: opendir() [function.opendir]: SAFE MODE Restriction in effect. The script whose uid is 0 is not allowed to access /home owned by uid 0 in /var/www/html/backups.php on line 8 Warning: opendir(/home/chris/PBPCBackup/) [function.opendir]: failed to open dir: No such file or directory in /var/www/html/backups.php on line 8 = I got this error as well prior to changing the safe mode parameter... Still lost, but searching :( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec question
On Wed, 2003-10-08 at 14:51, Marek Kilimajer wrote: Did you edit the right php.ini? Check out phpinfo() output for Configuration File (php.ini) Path Yep, tried that...it states /etc/php.ini, and lists other location of /etc/php/, but that directory doesn`t contain a php.ini file -- Chris Blake Support Consultant Office : (011) 782-0840 Fax: (011) 782-0841 Mobile : 083 985 0379 Website: http://www.pbpc.co.za Campus sidewalks never exist as the straightest line between two points. -- M. M. Johnston 14:56:07 up 21 days, 6:26, 3 users, load average: 0.48, 0.25, 0.21 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec question
I think that ALL files in other location are parsed, it does not need to be named php.ini Chris Blake wrote: On Wed, 2003-10-08 at 14:51, Marek Kilimajer wrote: Did you edit the right php.ini? Check out phpinfo() output for Configuration File (php.ini) Path Yep, tried that...it states /etc/php.ini, and lists other location of /etc/php/, but that directory doesn`t contain a php.ini file -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec question
On Wed, 2003-10-08 at 15:02, Marek Kilimajer wrote: I think that ALL files in other location are parsed, it does not need to be named php.ini I checked in /etc/php/ and it lists the following files : 23_gid.ini 26_imap.ini 27_ldap.ini 34_mysql.ini and 41_readline.ini All these files contain single entries e.g extension =readline.so and so on. Is there another file I should look for in /etc ? -- Chris Blake Support Consultant Office : (011) 782-0840 Fax: (011) 782-0841 Mobile : 083 985 0379 Website: http://www.pbpc.co.za A person forgives only when they are in the wrong. 15:08:37 up 21 days, 6:38, 3 users, load average: 0.33, 0.16, 0.14 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec question
Then check your httpd.conf for php_(admin_)?(flag|value) Chris Blake wrote: On Wed, 2003-10-08 at 15:02, Marek Kilimajer wrote: I think that ALL files in other location are parsed, it does not need to be named php.ini I checked in /etc/php/ and it lists the following files : 23_gid.ini 26_imap.ini 27_ldap.ini 34_mysql.ini and 41_readline.ini All these files contain single entries e.g extension =readline.so and so on. Is there another file I should look for in /etc ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec question
On Wed, 2003-10-08 at 15:23, Marek Kilimajer wrote: Then check your httpd.conf for php_(admin_)?(flag|value) I checked it but there is nothing for php whatsoever. -- Chris Blake Support Consultant Office : (011) 782-0840 Fax: (011) 782-0841 Mobile : 083 985 0379 Website: http://www.pbpc.co.za Anybody with money to burn will easily find someone to tend the fire. 15:35:56 up 21 days, 7:05, 3 users, load average: 0.08, 0.08, 0.14 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec question
On Wed, 2003-10-08 at 15:23, Marek Kilimajer wrote: Then check your httpd.conf for php_(admin_)?(flag|value) OK, so I`ve tried all the suggestions posted, thanks guys...but then I went and deleted the php.ini file in /etc, and still when I use phpinfo(); it gives me the usual phpinfo page... So where is the info coming from...another php.ini located somewhere else on my drive ? A search revealed naddaso I`m out of ideas right now. -- Chris Blake Support Consultant Office : (011) 782-0840 Fax: (011) 782-0841 Mobile : 083 985 0379 Website: http://www.pbpc.co.za buzzword, n: The fly in the ointment of computer literacy. 16:16:41 up 21 days, 7:46, 3 users, load average: 0.43, 0.20, 0.24 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] shell_exec question
On 08 October 2003 15:19, Chris Blake contributed these pearls of wisdom: On Wed, 2003-10-08 at 15:23, Marek Kilimajer wrote: Then check your httpd.conf for php_(admin_)?(flag|value) OK, so I`ve tried all the suggestions posted, thanks guys...but then I went and deleted the php.ini file in /etc, and still when I use phpinfo(); it gives me the usual phpinfo page... So where is the info coming from...another php.ini located somewhere else on my drive ? No, these will be PHP's built-in default values (which are the same as the ones in one of the php.ini-* included in the PHP distribution -- php.ini-dist, I think, but I could be wrong). The trick is to look at the phpinfo() output for Configuration file (php.ini) path -- if it only gives a directory's path (ending in /, without a php.ini filename on the end), than that is the path it is looking in, but there is no php.ini file there so the built-in defaults are being used. If it gives a full pathname ending with an actual filename, that is the file it is reading. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec question
Start here: grep -r safe_mode /* ;) Chris Blake wrote: On Wed, 2003-10-08 at 15:23, Marek Kilimajer wrote: Then check your httpd.conf for php_(admin_)?(flag|value) OK, so I`ve tried all the suggestions posted, thanks guys...but then I went and deleted the php.ini file in /etc, and still when I use phpinfo(); it gives me the usual phpinfo page... So where is the info coming from...another php.ini located somewhere else on my drive ? A search revealed naddaso I`m out of ideas right now. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec question
Chris Blake wrote: OK, so I`ve tried all the suggestions posted, thanks guys...but then I went and deleted the php.ini file in /etc, and still when I use phpinfo(); it gives me the usual phpinfo page... First, make sure to restart Apache after you do anything to php.ini Secondly, when php.ini is absent, php starts with default options. So where is the info coming from...another php.ini located somewhere else on my drive ? A search revealed naddaso I`m out of ideas right now. If there are any .htaccess files, they can include php overrides also. Check to make sure that local and master values are what you want them to be. -- Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec question
I thought about it, but safe mode can be set only in php.ini or httpd.conf Burhan Khalid wrote: Chris Blake wrote: OK, so I`ve tried all the suggestions posted, thanks guys...but then I went and deleted the php.ini file in /etc, and still when I use phpinfo(); it gives me the usual phpinfo page... First, make sure to restart Apache after you do anything to php.ini Secondly, when php.ini is absent, php starts with default options. So where is the info coming from...another php.ini located somewhere else on my drive ? A search revealed naddaso I`m out of ideas right now. If there are any .htaccess files, they can include php overrides also. Check to make sure that local and master values are what you want them to be. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec question
Is there a .htaccess file in (or above) the directory that the script is in? If so, look to see if safe mode is turned on there. Chris Blake wrote: On Wed, 2003-10-08 at 15:23, Marek Kilimajer wrote: Then check your httpd.conf for php_(admin_)?(flag|value) OK, so I`ve tried all the suggestions posted, thanks guys...but then I went and deleted the php.ini file in /etc, and still when I use phpinfo(); it gives me the usual phpinfo page... So where is the info coming from...another php.ini located somewhere else on my drive ? A search revealed naddaso I`m out of ideas right now. -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec question....
Kalin -- Please don't hijack threads. This question has nothing to do with your last questions regarding email address regular expressions. For that matter, *that* had nothing to do with php and perl. Mail and news messages have many headers, some of which serve to connect messages together. You can even change the Subject: as the discussion evolves or forks and the messages will all still be properly related to the right parents and children. This is a good thing, even though Microsoft Outlook really doesn't support it too well at all and many users of it have no threading or sorting capabilities. When starting a new topic, or thread, please start a fresh message. Not only is there no chance of forgetting to change the subject but the message also does not appear glued onto another message where it really doesn't belong. ...and then Kalin Mintchev said... % % hello list, Hi! % % what has to happened so this actually works: % % $mstrng = shell_exec(/usr/sbin/zip 0041_27032003223711.zip % 0041_27032003223711); Are you running under safe mode, which turns off shell execs? Can you call anything via shell_exec? Have you tried using system() instead? % % if php is compiled as a module with apache is the apache owner the one % that has to have writing permissions? if so - it does.. OK; that's a good start. We need more details, though. Tell us what you've done and what does or doesn't happen, including any error messages on the web page or in the apache log. % % any help appreciated... % % thank you HTH HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
[PHP] shell_exec question....
hello list, what has to happened so this actually works: $mstrng = shell_exec(/usr/sbin/zip 0041_27032003223711.zip 0041_27032003223711); if php is compiled as a module with apache is the apache owner the one that has to have writing permissions? if so - it does.. any help appreciated... thank you -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php