Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

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

Questions on Server Fault are expected to relate to professional 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

1 Answer 1

up vote 0 down vote accepted

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

share|improve this answer
    
Can you please tell me from where can I run this command on my remote web-server? –  user1767434 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. –  user1767434 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
    
I just tried it and it gave me "Internal Server Error" (error code:500) –  user1767434 Nov 1 '12 at 11:29

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