how can i disable safe mode for php on web server?

42,858

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:
42,858

Related videos on Youtube

Bushra Shahid
Author by

Bushra Shahid

I’m a web developer with over 3 years of professional experience in the design and development industry. i am full Stack Web Developer working with LAMP Stack, MySQL, SQL, PHP, OOP PHP, CodeIgniter MVC PHP Framework. Enthusiasm for PHP Web Development and Internet Technology with fined tuned problem solving and work flow implementation skills, providing an edge that allows delivery of projects that surpass expectations. I specialize in creating custom web sites for other businesses, focusing primarily on custom WordPress theme design and development and plugin development. I create beautiful, usable, professional websites using best practice accessibility and the latest W3C web standards guidelines, resulting in semantic and seo friendly XHTML and CSS. All my websites are lovingly hand coded. Currently i'm teaching myself, Mongodb and Laravel framework for web development. I am currently available for freelance work.

Updated on September 18, 2022

Comments

  • Bushra Shahid
    Bushra Shahid over 1 year

    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.

    • Tom O'Connor
      Tom O'Connor over 11 years
      Danger Will Robinson.
  • Bushra Shahid
    Bushra Shahid over 11 years
    Can you please tell me from where can I run this command on my remote web-server?
  • Hex
    Hex over 11 years
    You should run this command in terminal. What kind of access do you have in your server?
  • Bushra Shahid
    Bushra Shahid over 11 years
    The server is a shared one so I only have ftp access.
  • Hex
    Hex over 11 years
    Can you try to add "php_value safe_mode off" in your .htaccess and check if it helps?
  • DerfK
    DerfK over 11 years
    @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.
  • 71GA
    71GA almost 7 years
    In current version of PHP (7.1.8), there is no more safe_mode option. There is only sql.safe_mode. Is this the same?