skip to Main Content

I am using exec php built in function in my project. It is working perfectly on my local but on my cpanel it is not working perfectly.
The code on local and cpanel is same so I don’t know why it is not working.

I know exec function is disabled by default in live server but I have asked support and they are saying that they have enabled exec function but it is not working in my project.

exec code on local:

exec("swetest -edir$sweph -b$utdatenow -ut$utnow -p0123456789DAttt -eswe -house$my_longitude,$my_latitude,$h_sys -flsj -g, -head", $out);

response on local:

194.2488544

also give data in $out in array

exec code on cpanel:

exec("swetest -edir$sweph -b$utdatenow -ut$utnow -p0123456789DAttt -eswe -house$my_longitude,$my_latitude,$h_sys -flsj -g, -head", $out);

response on cpanel:

return empty value.

$out is also empty …

I don’t know where the issue coming?
Can someone help me to fix this?

2

Answers


  1. Try check your php.ini configurations for cPanel probably the exec function was disabled or display_errors is set to false, in case you not sure try copy your local php.ini content to your server php.ini and try again.

    Login or Signup to reply.
  2. On cPanel, go to MultiPHP Manager. Then Open the User Domain Settings tab, find the domain in the list and click the PHP-FPM Settings.
    In the "Disable Functions" paste these and then click "Update":
    passthru
    system
    shell_exec

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search