0
Answered

PHP from command line, different php.ini configuration

cracksilver 2 months ago updated 2 months ago 5

Hi there

I want to use a few command line tools in the cron folder. But I get an error from IonCube when I use a command in the cron folder.

user@ubuntuvm:/var/www/mydomain.com/cron$ sudo php make_thumbs.php user
Site error: the ionCube PHP Loader needs to be installed. This is a widely used PHP extension for running ionCube protected PHP code, website security and malware blocking.

Please visit get-loader.ioncube.com for install assistance.

user@ubuntuvm:/var/www/mydomain.com/cron$ 

IonCube is installed. I checked it with phpinfo.

Does someone know this problem?

Thanks for any advice.

Gregor

Answered

When running PHP via a webserver or running via command line, it's not always the same php.ini file in use. You can specify a particular php.ini with the "-C /path/to/php.ini" argument for the "php" binary.

thx. and what is the complete command in the terminal?

Thanks for your fast reply.

Where I can specify a particular php.ini with the "-C /path/to/php.ini" argument for the "php" binary.

Hi again

I looked where my php.ini is. There are two of them.


./etc/php/7.4/apache2/php.ini
./etc/php/7.4/cli/php.ini

then I tried it as follow in the cron folder:

user@ubuntuvm:/var/www/mydomain.com/cron$ php -c /etc/php/7.4/apache2/php.ini make_thumbs.php superuser

user@ubuntuvm:/var/www/mydomain.com/cron$ php -c /etc/php/7.4/cli/php.ini make_thumbs.php superuser

and get the same output:

Site error: the ionCube PHP Loader needs to be installed. This is a widely used PHP extension for running ionCube protected PHP code, website security and malware blocking.
Please visit get-loader.ioncube.com for install assistance.

Because I have added the files external I want to run the thumbnailmaker.

Thx for any advice.

greg

Hi again

Finally I got the right configuration and IonCube is running.

Had to add this line:

zend_extension = /usr/lib/php/20190902/ioncube_loader_lin_7.4.so

in this php.ini files:

./etc/php/7.4/apache2/php.ini
./etc/php/7.4/cli/php.ini


aswell as in

./etc/php/7.4/apache2/conf.d/00-ioncube.ini as you mentioned here in step 2: http://blog.filerun.com/how-to-install-filerun-on-ubuntu-20/


Got the informations from Step 4 in this HowTo: https://www.tecmint.com/install-ioncube-loader-in-ubuntu-debian/

Thread can be closed. thx