How to customize PHP settings in Plesk

Follow

Comments

8 comments

  • Avatar
    Michael M.

    Hello,

     

    but how to set setting that uses PHP for Crontab?

    For example i set in global PHH.ini how it written. And also i set it for domain.

    short_open_tag=on

    But when i start crontab, it runs task as short_open_tag=off

    What do i do whong?

     

    Thanks! 

  • Avatar
    Alisa Kasyanova

    @Michael M.
    Can you please clarify: do you run domain's Scheduled Task? Do you run it as a command or as a PHP script?

  • Avatar
    Michael M.

    Hi, Alisa!

    I run it as PHP Script in Tools & Settings->Scheduled Tasks

    Sorry i do no know (or do not have in panel) what is domain Scheduled Tasks. Please let me know what it is.

    But i take a script from domain folder that i have made.

     

    Suggest please how i must run it to work, and i will make so)

  • Avatar
    Alisa Kasyanova

    @Michael M.
    You may create a server-wide scheduled task (Tools & Settings > Scheduled Tasks), or for a specific domain (domain > Scheduled Tasks).
    Make sure that short_open_tag is specified only once in the php.ini (you may use ctrl+f and writing short_open_tag in a browser to find it on the page).
    Try to run the same task as "Run a command", use root user and command like this:
    /opt/plesk/php/7.0/bin/php ./var/www/vhosts/example.com/httpdocs/script-name.php
    Change the 7.0 to other PHP version for which you have enabled short_open_tag (and the script path).
    Check the domain > PHP Settings > View the phpinfo() page, is it showing that short_open_tag on?
    Hope this helps!

  • Avatar
    Michael M. (Edited )

    1. To run domain Sheduler - do not work. Also need to say that here http://prntscr.com/musj8y i have ony one choose. But i know nothing if it is FPM or FAstCGI  or maybe one deactivated http://prntscr.com/musjpq

    2. /opt/plesk/ - i do not have this folder. i have only /opt/psa and there no php folder inside.

    3. >>Check the domain > PHP Settings > View the phpinfo() page, is it showing that short_open_tag on?

    When i push this link i get one more error -

    Error: Unable to retrieve information about the PHP configuration. - http://prntscr.com/musm5i

     

    Alisa, could you tell - are you from Plesk support?

     

    Thanks!

  • Avatar
    Alexandr Redikultsev

    Hi @Michael M.,

    Alisa is indeed from Plesk Support :)

    And I suggest getting in contact with us directly as it seemed like there is some technical issue that worth looking into.

    You can submit a request to Plesk Technical Support as documented here: https://support.plesk.com/hc/en-us/articles/213608509

  • Avatar
    Michael M.

    I understood.

    There is full misunderstandnis in configuration. So:

    1. If i run normal Server Sheduler with option - Run a PHP script so it will be processed with this CLI PHP 7.2.15. Its ini is - /etc/php/7.2/cli/php.ini

    2. If i run normal Server Sheduler with option - Run a Command so it will be processed with another PHP 7.1.14. Its ini is - /opt/psa/admin/conf/php.ini

    3. If i run Domain Scheduler with option - Run a PHP script so it will be processed with this CLI PHP 7.2.15 as in first. But it do use domain specified INI file or domain specified ini setting! There is a big problem, that must be solved in next version of plesk.

     

    Thanks!

  • Avatar
    Taras Ermoshin

    Hello @Michael M.!

    I checked all three methods you mentioned, and here're the results:

    1. Tools & Settings > Scheduled Tasks > Add Task > Run a PHP script

    Depending on the selected PHP version (from OS vendor or provided by Plesk), the main php.ini for the PHP engine is used - it can be /etc/php/7.2/cli/php.ini (I guess you're running Debian 9), /etc/php.ini or /opt/plesk/php/7.1/etc/php.ini.

    2. Tools & Settings > Scheduled Tasks > Add Task > Run a command

    In this case, the used php.ini depends on the PHP binary which is specified in the field Command.

    3. Domains > example.com > Scheduled Tasks > Add Task > Run a PHP script

    The results here are the same as in the server-wide scheduled task (method 1).

     

    If you face different behavior, I recommend you submit a support ticket with providing the detailed steps which can be used to reproduce the issue (screenshots and screencasts can be very helpful in understanding the issue).

Please sign in to leave a comment.

Have more questions? Submit a request