PHP School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a PHP Expert!

Join 300,451 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,581 people online right now. Registration is fast and FREE... Join Now!




How to run shell_exec command at web site using php code.

 

How to run shell_exec command at web site using php code.

anil4u

2 Jul, 2009 - 09:36 PM
Post #1

New D.I.C Head
*

Joined: 4 Feb, 2009
Posts: 10


My Contributions

Hello,

Can anyone suggest how to overcome from this one.

Shell_exec is perfectly run in the localhost,
when i want to run that command at the web server, that is not executed.

chmod 7777 -R \public\test\sleepingbaby.jpg

presently that file has 0644 permission.

i want to change that file permission to full access that is 7777.

$cmd = "chmod 7777 -R \public\test\sleepingbaby.jpg";
$res=shell_exec ($cmd);
when i echo $res; then that not return any values.


Please give any solution for it.

Anil Kumar.
http://anil2u.wordpress.com

User is offlineProfile CardPM
+Quote Post


roudard

RE: How To Run Shell_exec Command At Web Site Using Php Code.

3 Jul, 2009 - 01:08 AM
Post #2

D.I.C Head
**

Joined: 26 Sep, 2005
Posts: 139



Thanked: 16 times
My Contributions
Hi,

when successful chmod doesn't return anything so $res would be empty. are the permissions not modified once you script has run ?
If not are you sure the www user has enough privileges to run chmod (although in that case you would get an error in $res)
btw i'm testing on mac os x
hope this helps
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 01:52AM

Live PHP Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month