Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Turn it off. Always leave it off.</p> <p>It was designed way back when as a way to make PHP <em>safe</em> to use on mass hosts, and let the hosts "lock down" PHP.</p> <p>But over time, it was realized that this didn't really work, and didn't really solve the problem anyway. There are better system-level ways of securing servers. So PHP is removing the functionality in the next major version and has it deprecated.</p> <p>So to directly answer your questions:</p> <p><strong>When should folks turn it on:</strong></p> <p>Never. It doesn't really work, and it limits what you can do with PHP in a sane way, so just don't turn it on.</p> <p><strong>When should folks keep it off:</strong></p> <p>Always. It doesn't really work, so there's no point to turning it on...</p> <p>That's my $0.02 anyway...</p> <p><strong>Edit: Some references</strong></p> <p>Everything you can do to a server, you can do with Safe Mode on, including: <a href="https://stackoverflow.com/questions/252615/getting-around-php-safe-mode-to-write-to-server-is-it-possible">It's possible to write to the webserver anyway</a>. So what's the point?</p> <p><a href="http://www.mail-archive.com/php-dev@lists.php.net/msg38155.html" rel="nofollow noreferrer">A mailing list thread from PHP about removing it in 6</a></p> <p><strong>Edit2</strong>: About speed:</p> <p>The speed difference is likely to be trivial at best. It's no more than a micro-optimization. You're going to get a far bigger gain by writing your code well than worrying about a specific configuration option such as this. Don't worry about the speed difference at all. Build your application properly, and worry about speed later. Not to mention that the choice of front end web server (Apache, IIS, Lighttpd, NginX, etc) and SAPI (mod_php, CGI, FastCGI, etc) will make a far bigger difference than safe_mode ever can...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload