I am using wkhtmltopdf for making a pdf of a page. My code executes the shell to run a command using this wkhtmltopdf library. Everything works fine in my wamp server but when the code runs on my web-server it does not work and gives the following error:

Warning: shell_exec() has been disabled for security reasons in /home/pssptech/public_html/.../cert.php on line 272

I think that the php is running on safe mode on the server that's why the shell execution is disabled. But the main problem is I am unable to find the php.ini file on my remote web-server.
Can you tell me where can I find the config file so that I can disable the safe mode?
Thanks in advance.

closed as off topic by Michael Hampton, mdpc, Scott Pack, Ward, Rob Moir Nov 1 '12 at 21:47

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Danger Will Robinson. – Tom O'Connor Nov 1 '12 at 11:08

Edit your php.ini and set the variable safe_mode to off.

safe_mode = Off

To find php.ini in linux run

find / -name php.ini -print

  • Can you please tell me from where can I run this command on my remote web-server? – Bushra Shahid Nov 1 '12 at 10:56
  • You should run this command in terminal. What kind of access do you have in your server? – Hex Nov 1 '12 at 11:00
  • The server is a shared one so I only have ftp access. – Bushra Shahid Nov 1 '12 at 11:03
  • Can you try to add "php_value safe_mode off" in your .htaccess and check if it helps? – Hex Nov 1 '12 at 11:15
  • 1
    @user1767434 then you'll need to ask your host to change it for you, and if they won't, then you'll need to change to a different host. – DerfK Nov 1 '12 at 13:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.