{"id":1170,"date":"2015-01-28T18:37:50","date_gmt":"2015-01-28T18:37:50","guid":{"rendered":"http:\/\/www.nikola-breznjak.com\/blog\/?p=1170"},"modified":"2015-08-10T06:55:26","modified_gmt":"2015-08-10T06:55:26","slug":"how-to-turn-off-php-safe-mode-in-plesk-10","status":"publish","type":"post","link":"https:\/\/nikola-breznjak.com\/blog\/stack-overflow\/how-to-turn-off-php-safe-mode-in-plesk-10\/","title":{"rendered":"How to turn off php safe mode in plesk 10?"},"content":{"rendered":"<p><a href=\"http:\/\/stackoverflow.com\/users\/534755\/nikola\"><img loading=\"lazy\" decoding=\"async\" title=\"profile for Nikola at Stack Overflow, Q&amp;A for professional and enthusiast programmers\" src=\"http:\/\/stackoverflow.com\/users\/flair\/534755.png\" rel=\"lightbox[1170]\" alt=\"profile for Nikola at Stack Overflow, Q&amp;A for professional and enthusiast programmers\" width=\"208\" height=\"58\" \/><\/a><br \/>\nI&#8217;m a big fan of <a href=\"http:\/\/stackoverflow.com\/\">Stack Overflow<\/a> and I tend to contribute regularly (am currently in the <a href=\"http:\/\/stackexchange.com\/leagues\/1\/alltime\/stackoverflow\/2008-07-31\/534755?sort=reputationchange#534755\">top 0.X%<\/a>).\u00a0In this category (<a href=\"http:\/\/www.nikola-breznjak.com\/blog\/category\/stack-overflow\/\">stackoverflow<\/a>)\u00a0of posts I will will be posting my top rated questions and answers. This, btw, is allowed as explained in the meta thread <a href=\"http:\/\/meta.stackoverflow.com\/questions\/266971\/can-i-post-so-questions-and-answers-in-a-personal-blog\/266973\">here<\/a>.<\/p>\n<p>My <a href=\"http:\/\/stackoverflow.com\/questions\/5134881\/how-to-turn-off-php-safe-mode-in-plesk-10\">question<\/a> was:<\/p>\n<p style=\"color: #222222;\">Please tell me how to do this from the Plesk interface (version 10).<\/p>\n<p style=\"color: #222222;\">Btw, if this is not possible through Plesk 10 interface then please tell me which one of these two files I have to change:<\/p>\n<pre class=\"lang:default decode:true\">[root@vps ~]# find \/-name php.ini\r\n\/etc\/php.ini\r\n\/usr\/local\/psa\/admin\/conf\/php.ini<\/pre>\n<p style=\"color: #222222;\"><strong>edit<\/strong>: Eventually I came to see that my main problem was not the safe mode but the open base dir. The link which helped me to solve that is this:\u00a0<a style=\"color: #0c65a5;\" href=\"http:\/\/snipplr.com\/view\/14249\/remove-openbasedir-restriction-for-a-specific-domain-in-plesk\/\" rel=\"nofollow\">remove openbasedir restriction for a specific domain in plesk<\/a>\u00a0which I&#8217;ll paste here in case that blog gets pulled off:<\/p>\n<p style=\"color: #222222;\">If you have an open_basedir restriction that is causing issues with a domain, you can remove the restriction easily. First, put the following text in\u00a0<code>\/home\/httpd\/vhosts\/[domain]\/conf\/vhost.conf<\/code>:<\/p>\n<pre class=\"lang:default decode:true \">&lt;Directory\/home\/httpd\/vhosts\/[domain]\/httpdocs&gt;\r\n  php_admin_flag engine on \r\n  php_admin_value open_basedir none\r\n&lt;\/Directory&gt;\r\n\r\n# If there was already a vhost.conf in the directory, then just reload Apache. Otherwise, run the magic wand:\r\n\r\n\/usr\/local\/psa\/admin\/bin\/websrvmng -av\r\n\r\n# Then bounce Apache:\r\n\r\n\/etc\/init.d\/httpd reload\r\n\r\n# BUT, if the client has both php4 and php5 things get a little more complicated, and you have to add the \"IfModule\" directive from the apache syntax, e.g.:\r\n\r\n&lt; Directory \/var\/www\/vhosts\/domain.com\/subdomains\/SUBDOMAIN\/httpdocs&gt;\r\n&lt; IfModule sapi_apache2.c&gt;\r\n      php_admin_flag engine on\r\n      php_admin_flag safe_mode off\r\n      php_admin_value open_basedir none\r\n&lt; \/IfModule&gt;\r\n&lt; IfModule mod_php5.c&gt;\r\n      php_admin_flag engine on\r\n      php_admin_flag safe_mode off\r\n      php_admin_value open_basedir none\r\n&lt; \/IfModule&gt;\r\n      Options +Includes -ExecCGI\r\n&lt; \/Directory&gt;\r\n\r\n# Or if you want to add a new location to open_basedir instead of disabling open_basedir, you would have:\r\n\r\nphp_admin_value open_basedir \"\/var\/www\/vhosts\/domain.com\/httpdocs:\/tmp:\/new\/path\/comes\/here\"<\/pre>\n<p>&nbsp;<\/p>\n<p>The answer, by <a style=\"color: #0c65a5;\" href=\"http:\/\/stackoverflow.com\/users\/237399\/eric-g\">Eric G<\/a>,\u00a0was:<\/p>\n<blockquote>\n<p style=\"color: #222222;\">Go to the control panel for the specific domain where you want to turn off safe mode, click on the Websites &amp; Domains tab. At the bottom will be a listing of the domain names, click on an individual name to see it&#8217;s hosting settings. There should be a checkbox for PHP, and another one for whether or not to use safe mode.<\/p>\n<p style=\"color: #222222;\">See also:\u00a0<a style=\"color: #0c65a5;\" href=\"https:\/\/manage.grabweb.in\/knowledgebase.php?action=displayarticle&amp;id=86\">https:\/\/manage.grabweb.in\/knowledgebase.php?action=displayarticle&amp;id=86<\/a><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m a big fan of Stack Overflow and I tend to contribute regularly (am currently in the top 0.X%).\u00a0In this category (stackoverflow)\u00a0of posts I will will be posting&hellip;<\/p>\n","protected":false},"author":1,"featured_media":609,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[],"class_list":["post-1170","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-stack-overflow"],"_links":{"self":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/1170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/comments?post=1170"}],"version-history":[{"count":5,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/1170\/revisions"}],"predecessor-version":[{"id":2028,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/1170\/revisions\/2028"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/media\/609"}],"wp:attachment":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/media?parent=1170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/categories?post=1170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/tags?post=1170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}