"popen" function not working in php

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

Thank you.

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

1 Like

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.

Please share your cron job command.

-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

I feel your PHP path is not good, take a look on this tutorial → How to Change CLI PHP on CyberPanel?

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

Did you read the tutorial I shared above? there is a cron section in there.

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.

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

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.