• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question Cronjobs: User-defined php settings?

JensN

New Pleskian
Hi,

I have an issue getting user-defined php settings working for cronjob / planned task entries. In detail I want to increase the memory limit for a laravel 5 cronjob. For the customer the php settings the memory limit is already raised (to 512M), but the default limit is at a lower value (128M).

If I use the "Execute PHP script" option I can properly setup the command line parameters and PHP-Version, but it will always use the global default values (128M). For obvious reasons I dont want to increase the memory limit for the whole server.

If I use the "Execute command" option I can not run the php script at all because the php executables are not available within the chroot environment. (Right?) For obvious reasons I don't want to enable unprotected shell access for the whole server. (Enabling that Option for a single customer would already be better, but still a workaround)

If I use the "Query URL" option I have to build a workaround (see below) for executing CLI commands from a php script. Also I have the cronjob script publicly accessible which may be used for DOS in the worst case (or at least putting high load on the server). Also not a desirable solution.
PHP:
<?php
$_SERVER['argv'] = [ "artisan", "queue:work", "--queue=plugins,default", "--once" ];
include "../artisan";

Is there any better way to solve this? I'm really staggered that I couldn't find anything about this even after extensive search, since this should actually be a pretty common issue?

Thanks in advance
Best regards Jens N
 
Last edited:
Hello,

to increase php memory_limit , you can edit directly the php.ini configuration in Tools & Settings > PHP settings > php version you want to use to run your cronjob.
Then go in the tab php.ini and find the variable memory_limit
 
Up until recently I haven't had any clients with a need to run PHP scripts....
But now I have.

He's using the GIT extension and after it is finished he needs to run a PHP-script.

I already created a chroot environment for him and because his script didn't run properly I started investigating it.
By default it uses the OS-php that I prepared for him in chroot...
His script insisted on using PHP 7.1.2...
So I decided to add the Plesk PHP 7.1.2 to his environment too...

I think that's the best you can do for that client.
It will also give you the possibility to test things on an SSH-prompt in HIS environment...

It took me a month to refine the chroot environment. Of course not that many hours... But playing with it, you'll find that something doesn't work...

I think it runs fine now....
The (external) webmaster of our client wanted to move the website to a VPS so he could have root access. I convinced him to stay on our Plesk system and offered him the chroot environment.
 
Last edited:
Back
Top