1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

How to globally disable php safe_mode for domain on creation

Discussion in 'Plesk 9.x for Linux Issues, Fixes, How-To' started by InfinityHS, Dec 9, 2009.

  1. InfinityHS

    InfinityHS New Pleskian

    19
    35%
    Joined:
    Dec 9, 2009
    Messages:
    9
    Likes Received:
    0
    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
     
  2. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,576
    Likes Received:
    1,244
    Location:
    Novosibirsk, Russia
    I can suggest you create 'Domain created' Event and use /usr/local/psa/bin/domain with option '-php_safe_mode false' as Command there.
     
  3. InfinityHS

    InfinityHS New Pleskian

    19
    35%
    Joined:
    Dec 9, 2009
    Messages:
    9
    Likes Received:
    0
    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
     
  4. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,576
    Likes Received:
    1,244
    Location:
    Novosibirsk, Russia
    Just click 'Help' link when you will be at Event page and you will see sample there.
     
  5. InfinityHS

    InfinityHS New Pleskian

    19
    35%
    Joined:
    Dec 9, 2009
    Messages:
    9
    Likes Received:
    0
    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
     
  6. InfinityHS

    InfinityHS New Pleskian

    19
    35%
    Joined:
    Dec 9, 2009
    Messages:
    9
    Likes Received:
    0
    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?
     
  7. InfinityHS

    InfinityHS New Pleskian

    19
    35%
    Joined:
    Dec 9, 2009
    Messages:
    9
    Likes Received:
    0
    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
     
  8. InfinityHS

    InfinityHS New Pleskian

    19
    35%
    Joined:
    Dec 9, 2009
    Messages:
    9
    Likes Received:
    0
    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: Jan 11, 2010
Loading...