Configuring open_basedir to allow access to a script for all sites

  • Hello


    I run a script on all of my websites and I have it in a folder that is outside of the main www folder and the open_basedir is blocking it from running. What I would like to know is how can I allow access to this folder where my scripts are installed so the sites can access them and allow them to execute without comprimising the security of my sites or control panel.


    If I disable open_basedir then my sites work and my scripts work.


    My scripts are in a folder (for this post I will call the folder 'examplescripts' )


    Thanks :)

    Edited once, last by veg-grower ().

  • Hello ;


    See at the admin/settings.php interface. You will see an option to configure the open_basedir paths.


    The setting is called: Value for the open_basedir directive


    and you can see tooltip that say:


    Code
    1. The directory file paths are appended to the default PHP open_basedir directive of customers. Each of them must be separated by PATH_SEPARATOR. See the PHP documentation for more information.


    Thanks you for using i-MSCP


    gOOvER Sorry, we answered in same time :D

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

    Edited once, last by Nuxwin ().

  • :shy: Thanks for the reply and help.


    Just to confirm (as I am not the brightest button in the box when it comes to these problems) if my scripts are in a folder called examplescripts which is located on the main directory structure as the etc and var folder then would I add /examplescripts/ or would I need to add /examplescripts ??


    Also would all folders and scripts inside /examplescripts also exicute without errors?


    Thanks in advance for your help and I am really enjoying using i-mscp it is the best control panel I have ever used! Its Great. :shy:

    Edited once, last by veg-grower ().


  • Re ;


    You must use absolute path.


    If your script is in /etc/examplefolder then, you must add the following path: /etc/examplefolder


    You can add multiple paths separated by PATH_SEPARATOR (colon also called dot-point) in this way: /etc/examplefolder:/var/examplefolder


    Thanks you for using i-MSCP.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

    Edited once, last by Nuxwin ().