Nikola Brežnjak blog - Tackling software development with a dose of humor
  • Home
  • Daily Thoughts
  • Ionic
  • Stack Overflow
  • Books
  • About me
Home
Daily Thoughts
Ionic
Stack Overflow
Books
About me
  • Home
  • Daily Thoughts
  • Ionic
  • Stack Overflow
  • Books
  • About me
Nikola Brežnjak blog - Tackling software development with a dose of humor
Stack Overflow

How to turn off php safe mode in plesk 10?

profile for Nikola at Stack Overflow, Q&A for professional and enthusiast programmers
I’m a big fan of Stack Overflow and I tend to contribute regularly (am currently in the top 0.X%). In this category (stackoverflow) of posts I will will be posting my top rated questions and answers. This, btw, is allowed as explained in the meta thread here.

My question was:

Please tell me how to do this from the Plesk interface (version 10).

Btw, if this is not possible through Plesk 10 interface then please tell me which one of these two files I have to change:

[root@vps ~]# find /-name php.ini
/etc/php.ini
/usr/local/psa/admin/conf/php.ini

edit: 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: remove openbasedir restriction for a specific domain in plesk which I’ll paste here in case that blog gets pulled off:

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 /home/httpd/vhosts/[domain]/conf/vhost.conf:

<Directory/home/httpd/vhosts/[domain]/httpdocs>
  php_admin_flag engine on 
  php_admin_value open_basedir none
</Directory>

# If there was already a vhost.conf in the directory, then just reload Apache. Otherwise, run the magic wand:

/usr/local/psa/admin/bin/websrvmng -av

# Then bounce Apache:

/etc/init.d/httpd reload

# 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.:

< Directory /var/www/vhosts/domain.com/subdomains/SUBDOMAIN/httpdocs>
< IfModule sapi_apache2.c>
      php_admin_flag engine on
      php_admin_flag safe_mode off
      php_admin_value open_basedir none
< /IfModule>
< IfModule mod_php5.c>
      php_admin_flag engine on
      php_admin_flag safe_mode off
      php_admin_value open_basedir none
< /IfModule>
      Options +Includes -ExecCGI
< /Directory>

# Or if you want to add a new location to open_basedir instead of disabling open_basedir, you would have:

php_admin_value open_basedir "/var/www/vhosts/domain.com/httpdocs:/tmp:/new/path/comes/here"

 

The answer, by Eric G, was:

Go to the control panel for the specific domain where you want to turn off safe mode, click on the Websites & Domains tab. At the bottom will be a listing of the domain names, click on an individual name to see it’s hosting settings. There should be a checkbox for PHP, and another one for whether or not to use safe mode.

See also: https://manage.grabweb.in/knowledgebase.php?action=displayarticle&id=86

Books

The Richest Man in Babylon – George S. Clason

My favourite quotes from the book The Richest Man in Babylon:

A part of all you earn is yours to keep.

Why should so few men be able to acquire all the gold? Because they know how. One may not condemn the man for succeeding because he knows how. Neither may one with justice take away from a man what he has fairly earned, to give to a man of less ability.

If you get paid 10 coins, take out only nine for spending.

A man’s wealth is not in the coins that he carries in his purse, but in the income he builds. The stream of money that comes in constantly whether you work or travel.

That’s what each of us calls necessary expenses will always grow to equal our incomes unless we protest to the contrary. Don’t confuse necessities with desires.

Preceding all accomplishment must be desire, which is strong and definite. The wish to be rich is of little purpose, but to desire 10 pieces of gold is a tangible desire which he can press to fulfillment.

The more wisdom we know, the more we may earn.

That man who seeks to learn more of his craft will be richly rewarded.

Where determination is, the way can be found.

The hungrier one becomes, the clear ones mind becomes.

How can you call yourself a free man when your weakness has brought you here. If a man has in himself a soul of a slave, will he not become one no matter what his birth?

Recent posts

  • Discipline is also a talent
  • Play for the fun of it
  • The importance of failing
  • A fresh start
  • Perseverance

Categories

  • Android (3)
  • Books (114)
    • Programming (22)
  • CodeProject (35)
  • Daily Thoughts (77)
  • Go (3)
  • iOS (5)
  • JavaScript (127)
    • Angular (4)
    • Angular 2 (3)
    • Ionic (61)
    • Ionic2 (2)
    • Ionic3 (8)
    • MEAN (3)
    • NodeJS (27)
    • Phaser (1)
    • React (1)
    • Three.js (1)
    • Vue.js (2)
  • Leadership (1)
  • Meetups (8)
  • Miscellaneou$ (77)
    • Breaking News (8)
    • CodeSchool (2)
    • Hacker Games (3)
    • Pluralsight (7)
    • Projects (2)
    • Sublime Text (2)
  • PHP (6)
  • Quick tips (40)
  • Servers (8)
    • Heroku (1)
    • Linux (3)
  • Stack Overflow (81)
  • Unity3D (9)
  • Windows (8)
    • C# (2)
    • WPF (3)
  • Wordpress (2)

"There's no short-term solution for a long-term result." ~ Greg Plitt

"Everything around you that you call life was made up by people that were no smarter than you." ~ S. Jobs

"Hard work beats talent when talent doesn't work hard." ~ Tim Notke

© since 2016 - Nikola Brežnjak