Shell Script is not executing with php script

Links for php scripts

Moderators: egami, macek, gesf

Post Reply
Emy
New php-forum User
New php-forum User
Posts: 16
Joined: Sat Jun 02, 2012 8:16 pm

Mon Jun 04, 2012 9:57 pm

I think it is a disabled function on the server side, if you have access to the server php.ini, then you could delete it, otherwise contact your server admin, reason it is disabled, is for security reason:

Code: Select all

disable_functions = symlink,shell_exec,exec,proc_close,proc_open,popen,system,dl,passthru,escapeshellarg,escapeshellcmd

User avatar
ejsexton82
New php-forum User
New php-forum User
Posts: 86
Joined: Mon Jun 04, 2012 10:05 pm
Location: Ankara, Turkey
Contact:

Tue Jun 05, 2012 11:04 am

You also have to be careful when specifying relative paths using dot notation. I had a lot of trouble myself getting shell scripts to execute in both the PHP client and on the website.

I always specify a path relative to the PHP file now:

Code: Select all

$output = shell_exec(dirname(__FILE__) . '/script.sh');

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest