CyberPanel Community

Closed"popen" function not working in php

th
thecreator #1

Hi, I think the “popen” function is not working. How can I check this?

Thank you.

9 replies
sh
shoaibkk #2

Open your php.ini from the ssh and just remove open from the disable_functions = this line

th
thecreator #3

Hello @shoaibkk

I checked the php.ini file in cyberpanel advanced php settings. The “popen” function is not disabled. I guess crontab is not running. I created a cron job from Cyberpanel but when I checked from ssh it doesn’t show up. The software we use gives an error like this;

“Notice: Crontab is not available in your system or you don’t have permission to use it. Please manually create the following cron job in your hosting control panel.”

The cron job was created but I guess it’s not running.

th
thecreator #5

-q /home/app.example.com/public_html/cron.php

In addition, there is a note in the system; @usmannasir
Cron Job (just this one entry to trigger all enabled services):
***** php -q /home/app.example.com/public_html/cron.php

th
thecreator #7

I’m not sure how to do this. @usmannasir
I created the subdomain just like creating a new website. Could this be a problem?

th
thecreator #9

Yes, I read that part. @usmannasir

How to use specific PHP Version in your Cron Jobs?
Some applications requires you to set cron jobs and they require PHP CLI executable. Now rather then changing default global php binary version, you can use direct path to that CLI.

For example an application requires that its script should be running through PHP 7.2, you can use the direct path for its binary rather then updating a global binary, such as

/usr/local/lsws/lsphp71/bin/php <your command goes here>

Am I only supposed to change the cron command like this?;
/usr/local/lsws/lsphp74/bin/php -q /home/app.example.com/public_html/cron.php

I did this but it didn’t work.

th
thecreator #10

Hello @usmannasir
The problem was due to open_basedir. I disabled open_basedir and the error went away. Thanks.

Sign in to reply