• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

How to globally disable php safe_mode for domain on creation

InfinityHS

New Pleskian
Hi all,

I'm wanting to know if there is a way to set the system to NOT enable the php safe_mode checkbox for each domain upon creation. Our billing software creates accounts and domains based on client and domain templates, so it doesn't directly call the API functions to turn safe_mode off on each domain creation. Has anyone figured out how to do this?

Thanks,

Rob
Infinity
 
I can suggest you create 'Domain created' Event and use /usr/local/psa/bin/domain with option '-php_safe_mode false' as Command there.
 
Just to be clear about Event Handler

Hi Igor,

Thanks for the point in the right direction. I looking through the docs more but couldn't find any clear how-tos for the Event Handler so I just want to make sure I have this correct.

I create a new Event Handler with the following settings:

Event will be "Domain created"
Priority 0? Does it matter since it's my only 1?
User root?
Command: /usr/local/psa/bin/domain -php_safe_mode false (just like that, no quotes, tics etc)?

Then whenever the system creates a new domain, it should turn off the safe_mode box for php?

TIA
Rob
 
Just click 'Help' link when you will be at Event page and you will see sample there.
 
Not really helpful

Hi Igor,

I looked at the help and it's the same help I found before when researching this. It just doesn't explain how to accomplish this. Can I get a step by step or is there some kind of documentation that shows how to do this? You guys may understand how it works, but the help does me no good.

I have several uses for the event handler but have no clue how to utilize this tool. A good example is I need to change all files in the httpdocs folder to 644 and all folders in the httpdocs folder to 755 because we now are running suPHP and all of the applications we have in the application installer run 777 folder permissions which breaks in suPHP.

Thanks in advance,

Rob
 
Has anyone used the Event Handler?

Has anyone run into this issue? Am I the only one who doesn't understand the documentation for the Event Handlers?

Can anyone give me a hand on how to use the event handler to perform simple tasks?

Bueller?
 
Can anyone help with the event handler?

Anyone out there who has sucessfully done event handlers, please help. The plesk docs are pretty much useless and don't tie into what Igor is saying at all.

I've tried the following variations and none of them work. The docs say this and this only:

Syntax: <command> [<parameter 1> <parameter 2> ... <parameter N>]
I try this as my Event Handler: /usr/local/psa/bin/domain <old_domain_name> <new_domain_name> '-php_safe_mode false'

I've tried several variations and every time I create a new domain, the PHP Safe Mode box is checked.

Thanks!
Rob
 
A Solution finally!

Ok, The event handler documentation isn't the best, that we know...but I have the solution after HOURS and HOURS of digging and testing. Here's the solution if you want to disable php_safe_mode on new domains that are created by any means other than manually.

Set up an Event Handler like so:
The Event has to be 'Physical hosting created'.
The priority and user can be defaul (0 and root)
The Command should be like this:
/usr/local/psa/bin/domain -u <new_domain_name> -php_safe_mode false

This will set the php safe_mode to off instead of the default on (true) when a new domain is created using an external API or other (we use WHMCS which creates domains and clients based on templates).

I actually found this command help here: http://download1.parallels.com/Plesk/PPP9/Doc/en-US/plesk-9.2-unix-cli/37768.htm

Hope it helps someone else because I spent hours because Parallels wouldn't give me the actual command or point me to the right place to even look. I do want to thank Igor for pointing me in the right direction. Thanks Igor!
 
Last edited:
Back
Top