php shell_exec() command is not working
If it works well in shell, I think apache is chrooted. So php can't find /var/...
Or user of httpd user does not have permission to enter /var/...
If you are good at PHP. Open dir /var/... And readdir() and check dir exists and check file exists.
This question might help you. scanning /home/ with opendir()
php shell_exec can run command but not sh file
this will fix ur problem
$output = shell_exec('sudo /usr/bin/sh /var/www/1.sh > /dev/null 2>&1');
Related Topics
Check If Two Arrays Have the Same Values
Python Format Datetime with "St", "Nd", "Rd", "Th" (English Ordinal Suffix) Like PHP's "S"
PHP Pdo Insert Batch Multiple Rows with Placeholders
How to Set for Specific Directory Open_Basedir
How to Convert All Images to Jpg
How to Store Birthdate and Age So That Age Can Be Updated Daily in PHP/Mysql
Replace Ereg_Replace with Preg_Replace
Get "Content-Type" Header of Request in PHP
Upload Images on Twitter Using PHP
In PHP, How to Get the First and Last Date of a Month
Add ".Active" Class to the Current Page's Link in a Menu Using Jquery or PHP
Laravel Cannot Delete or Update a Parent Row: a Foreign Key Constraint Fails
How to Convert Object into String in PHP
How to Create a New Joomla User Account from Within a Script
Connection Reset by Peer: Mod_Fcgid: Error Reading Data from Fastcgi Server