• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Problem with "Planned Task"

Fabhino22Elz

Basic Pleskian
Hello,
i use Plesk Onyx in Version 17.5.3 on my Webserver.

I am Running multiple Domains in Abbonements, so i have several vhosts generated in plesk. My Folder Structure is like this:

/var/www/vhosts/domain1.com/httpdocs/...
/var/www/vhosts/domain2.com/httpdocs/...
/var/www/vhosts/domain3.com/httpdocs/...

They where all with /bin/sh access

In this Abonements i created several planned Tasks (Cronjobs) in that way:

/opt/plesk/php/7.0/bin/php /var/www/vhosts/domain1.com/httpdocs/bin/export -p "article_images" /files/export/images.csv

Theese Jobs worked fine.

Now a Friend told me, that i should not use /bin/sh on a multiple domain server and should use /bin/bash (chrooted) so i changed the settings.

But now the planned Tasks dont work. I get the following message:
-: /opt/plesk/php/7.0/bin/php: No such file or directory

I understand that that is because the jobs only work in the domain1.com directory now.

But how can i start the cronjob in this folder? I tried several ways, but in the domain1.com folder /usr/bin is no php.
So it says this "-: /usr/bin/php: No such file or directory"

How do i have to change the Settings to get the tasks running again?

Greetings
 
Thank you for your answer. That helped a little bit.

Now i get the following message when i run the Cronjob:

No entry for terminal type "dumb";
using dumb terminal settings.
PHP Fatal error: Can't use method return value in write context in /httpdocs/Subscriber.php on line 96
 
Hi YourShopPartner,

PHP Fatal error: Can't use method return value in write context in /httpdocs/Subscriber.php on line 96
The error message states clear, that it is content related => "/httpdocs/Subscriber.php on line 96" and you don't provide the file within your post. This makes it not possible to investigate the error together with you. We can't even guess, if it might be Plesk - related, or not. :(
 
Ok, sorry for that Mistake. So here are some further Informations:

Die Aufgabe "/bin/php /httpdocs/bin/console sw:importexport:export -p "article_images" /files/export/images.csv" wurde in 0 Sekunden abgeschlossen, jedoch traten Fehler auf

No entry for terminal type "dumb";
using dumb terminal settings.
PHP Fatal error: Can't use method return value in write context in /httpdocs/engine/Shopware/Components/LastArticlesSubscriber.php on line 96

In that line you find this here:

if (empty($config->offsetGet('lastarticles_show'))) {
return;
}

So i dont understand why this is not working in chrooted. When i have start it with bin/sh access everything works fine.

Maybe it is, beause of not explicit saying that it should run with php7?
 
Hi YourShopPartner,

pls. note that you have the choice to use PHP - version - related commands by choosing different command paths. The command "php" ( or "/usr/bin/php" ) will use the serverwide PHP version installed on your server, while
Code:
/opt/plesk/php/5.2/bin/php
/opt/plesk/php/5.3/bin/php
/opt/plesk/php/5.4/bin/php
/opt/plesk/php/5.5/bin/php
/opt/plesk/php/5.6/bin/php
/opt/plesk/php/7.0/bin/php
/opt/plesk/php/7.1/bin/php
... will be used as paths for the Plesk PHP versions.

The used "chrooted" path "/bin/php", from your used command, is based on the unique executables from "/var/www/vhosts/chroot/bin", where you are able to add additional programs with the help of the Plesk KB - article: => How to add and remove programs to a chrooted shell environment template .

Pls. note, that we don't know, if your content has dependecies to a special PHP version. Your content provider should inform you about it.
We can't "debug" your content, because it is job for your content provider and again for your case, the command "/bin/php /httpdocs/bin/console sw:importexport:export ..." wants to execute an additional command "dumb", which is an indication, that it is trying to create a backup from a specific database ( used with unique selections ) over either python or the program "mysqldump", while the used additional command is not included at the unique, defined programs at "/var/www/vhosts/chroot/bin".
 
Last edited by a moderator:
Hello UFHH=!,

thank you for your reply.

Yeah, with the first point i used the task as a /bin/sh task as you see in my first task. the chrooted bin/php uses the php version for the choosen domain / abonement, is that right? So this would be php 7.

So i guess i need to add mysql dump or python to the chrooted shellß

is there a wiki or something else how i can do this?
 
Ok, the content provider asked if i use php 7 for my planned task.

I use php 7 for the domain, where i want to use the planned task. So i followed your linked instructions to add php to the chrooted.

So does the planned task use php 7 with the php order that is used now?

sorry for my bad english.
 
Hi YourShopPartner,

how can i change the used php version in the chrooted shell?
Am I correct, when I assume, that you used the given example at => How to add new programs to a chrooted shell environment template? without using the paths for your desired PHP - version?

Example for Plesk PHP version 7.0:

/opt/plesk/php/7.0/bin/php ( binary )

/opt/plesk/php/7.0/bin/php -i | grep extension_dir ( possible additional modules paths lookup, which then would result in a suggested command like ):

Code:
for f in /opt/plesk/php/7.0/lib/php/modules/*.so ; do ./chroot_update.sh --add $f ; done
rm -f /var/www/vhosts/chroot/bin/*.so

Code:
mkdir /var/www/vhosts/chroot/usr/lib64
cp -a /opt/plesk/php/7.0/lib/php/modules /var/www/vhosts/chroot/usr/lib64

Code:
cp -a /opt/plesk/php/7.0/etc/php.ini /opt/plesk/php/7.0/etc/php.d /var/www/vhosts/chroot/etc
 
Thank you for your answer.

I had to adjust it a little bit, because the files to copy were not located in lib, they where located in lib64:

for f in /opt/plesk/php/7.0/lib64/php/modules/*.so ; do ./chroot_update.sh --add $f ; done
rm -f /var/www/vhosts/chroot/bin/*.so

mkdir /var/www/vhosts/chroot/usr/lib64
cp -a /opt/plesk/php/7.0/lib64/php/modules /var/www/vhosts/chroot/usr/lib64

Now i can see the copied fiels in the chroot folders. I updated with the update_chroot.sh file, so all Domains are now with the new settings.

When i run the /bin/php -v it still shows that php is running under version 5.4.16.

But when i start the planned task in the chrooted shell it now shows this message here:

Failed loading ioncube_loader_lin_7.0.so: ioncube_loader_lin_7.0.so: cannot open shared object file: No such file or directory
Failed loading opcache.so: opcache.so: cannot open shared object file: No such file or directory
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mysqlnd.so' - /usr/lib64/php/modules/mysqlnd.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/apcu.so' - /usr/lib64/php/modules/apcu.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/bcmath.so' - /usr/lib64/php/modules/bcmath.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/dba.so' - /usr/lib64/php/modules/dba.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/enchant.so' - /usr/lib64/php/modules/enchant.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/imagick.so' - /usr/lib64/php/modules/imagick.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/intl.so' - /usr/lib64/php/modules/intl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/ldap.so' - /usr/lib64/php/modules/ldap.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mcrypt.so' - /usr/lib64/php/modules/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/odbc.so' - /usr/lib64/php/modules/odbc.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_odbc.so' - /usr/lib64/php/modules/pdo_odbc.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_pgsql.so' - /usr/lib64/php/modules/pdo_pgsql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pgsql.so' - /usr/lib64/php/modules/pgsql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/posix.so' - /usr/lib64/php/modules/posix.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pspell.so' - /usr/lib64/php/modules/pspell.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/redis.so' - /usr/lib64/php/modules/redis.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/soap.so' - /usr/lib64/php/modules/soap.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/sysvmsg.so' - /usr/lib64/php/modules/sysvmsg.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/sysvsem.so' - /usr/lib64/php/modules/sysvsem.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/sysvshm.so' - /usr/lib64/php/modules/sysvshm.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/tidy.so' - /usr/lib64/php/modules/tidy.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/xmlrpc.so' - /usr/lib64/php/modules/xmlrpc.so: cannot open shared object file: No such file or directory in Unknown on line 0
No entry for terminal type "dumb";
using dumb terminal settings.
PHP Fatal error: Can't use method return value in write context in /httpdocs/engine/Shopware/Components/LastArticlesSubscriber.php on line 96

Any ideas?

Greetings
 
Hi YourShopPartner,

as you can see within your error - messages, all modules couldn't be loaded:
cannot open shared object file: No such file or directory in Unknown on line 0
This leads to the fact, that you either missed a step, you might have forget to copy the *.so - files, or used a different path. ;)



Consider to use a "FIND" - command for example, to search for existent files and you are not sure about the current path:
Code:
find /var/www/vhosts/chroot -type f -name "*.so" -exec grep --color -Hni "mysqlnd" {} \;
or/and
Code:
find /var/www/vhosts/chroot -type f -name "*.ini" -exec grep --color -Hni "apcu" {} \;
...
...
or use a "locate" - command instead ( if the package "mlocate" is installed on your server ):
Code:
updatedb
locate mysqlnd.so
 
Last edited by a moderator:
well, i guess there is a missconfiguration.

if i look at the filesystem, i now have the following structure:
/var/www/vhosts/chroot/usr/bin where the php file is located, that i run with the command.

with your command i copyed the .so files to the following folder:
/var/www/vhosts/chroot/usr/lib64/modules

There i can find all the *.so files from php 7.

But there is also a nother folder:
/var/www/vhosts/chroot/usr/lib64/php/modules
where are all the .so files from php5.

So is the mistake that the php7 files should be located in
/var/www/vhosts/chroot/usr/lib64/php/modules

instead of
/var/www/vhosts/chroot/usr/lib64/modules

Could that be the mistake?

Greetings
 
Hi YourShopPartner,

When i run the /bin/php -v it still shows that php is running under version 5.4.16.
... which indicates, that you might have copied the correct PHP - executable, but because you use incorrect paths at your configuration files, the wrong PHP - versions is going to be displayed. :(

But there is also a nother folder:
/var/www/vhosts/chroot/usr/lib64/php/modules
where are all the .so files from php5.
... which you don't need, because you want to use the Plesk PHP 7 version modules. ;)

Is there a reason, why you don replace the *.so - files from "/var/www/vhosts/chroot/usr/lib64/modules" with the ones from "/var/www/vhosts/chroot/usr/lib64/php/modules", as you already noticed, that your PHP executable uses different paths?
 
ok, i replaced the files in one chroot folder to test it, but the message is still the same:

But in the chrooted folder, that he says the files are not there, the files are there - if i change to the chrooted folder of the specific domain i find all the files that he says, that he is missing... :-(


Failed loading ioncube_loader_lin_7.0.so: ioncube_loader_lin_7.0.so: cannot open shared object file: No such file or directory
Failed loading opcache.so: opcache.so: cannot open shared object file: No such file or directory
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mysqlnd.so' - /usr/lib64/php/modules/mysqlnd.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/apcu.so' - /usr/lib64/php/modules/apcu.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/bcmath.so' - /usr/lib64/php/modules/bcmath.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/dba.so' - /usr/lib64/php/modules/dba.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/enchant.so' - /usr/lib64/php/modules/enchant.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/imagick.so' - /usr/lib64/php/modules/imagick.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/intl.so' - /usr/lib64/php/modules/intl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/ldap.so' - /usr/lib64/php/modules/ldap.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mcrypt.so' - /usr/lib64/php/modules/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/odbc.so' - /usr/lib64/php/modules/odbc.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_odbc.so' - /usr/lib64/php/modules/pdo_odbc.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_pgsql.so' - /usr/lib64/php/modules/pdo_pgsql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pgsql.so' - /usr/lib64/php/modules/pgsql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/posix.so' - /usr/lib64/php/modules/posix.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pspell.so' - /usr/lib64/php/modules/pspell.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/redis.so' - /usr/lib64/php/modules/redis.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/soap.so' - /usr/lib64/php/modules/soap.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/sysvmsg.so' - /usr/lib64/php/modules/sysvmsg.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/sysvsem.so' - /usr/lib64/php/modules/sysvsem.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/sysvshm.so' - /usr/lib64/php/modules/sysvshm.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/tidy.so' - /usr/lib64/php/modules/tidy.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/xmlrpc.so' - /usr/lib64/php/modules/xmlrpc.so: cannot open shared object file: No such file or directory in Unknown on line 0
No entry for terminal type "dumb";
using dumb terminal settings.
PHP Fatal error: Can't use method return value in write context in /httpdocs/engine/Shopware/Components/LastArticlesSubscriber.php on line 96
 
Hi YourShopPartner,

japp, I got further ideas, as the documentations states:

Code:
Note: This section is applicable is only for system PHP and not for additional ones

You have to go another way, as my previous recommendation at => #12 might not work as expected.


Pls. consider to use ( step-by-step! ):
  • Pls. log in as user "root" over SSH
  • Pls. make sure that you will use the correct path for "update_chroot.sh" ( in my case, it is "/root/addons/Plesk/update_chroot.sh" ! )
Code:
( Make a backup of your current serverwide PHP - executable):[/INDENT]
mv /usr/bin/php /usr/bin/php.backup

(Create a symlink to your desired Plesk - PHP - version - executable ):
ln -s /opt/plesk/php/7.0/bin/php /usr/bin/php

( Add the current serverwide PHP - executable and its depending files to your chrooted environment )
/root/addons/Plesk/update_chroot.sh --add php

( Pls. inspect your output from your command line, as this may help to investigate ( possible ) issues/errors/problems! )

( Follow the recommendations from the above mentioned KB - article! )
mkdir /var/www/vhosts/chroot/usr/share
cp -a /usr/share/zoneinfo /var/www/vhosts/chroot/usr/share

( Open a NEW shell and login with a domain - user, which has access to a chrooted shell! )
( Locate the modules directory and note the path! )
php -i | grep extension_dir

( Go back to your previous "root" - shell )
for f in /opt/plesk/php/7.0/lib/php/modules/*.so ; do /root/addons/Plesk/chroot_update.sh --add $f ; done
rm -f /var/www/vhosts/chroot/bin/*.so

( Follow the recommendations from the above mentioned KB - article! )
mkdir /var/www/vhosts/chroot/usr/lib64
cp -a /opt/plesk/php/7.0/lib /var/www/vhosts/chroot/usr/lib64

( Follow the recommendations from the above mentioned KB - article! )
cp -a /opt/plesk/php/7.0/etc/php.ini /opt/plesk/php/7.0/etc/php.d /var/www/vhosts/chroot/etc

( Update your domain - specific chrooted shells with the new executable )
/root/addons/Plesk/update_chroot.sh --apply YOUR-DOMAIN.COM YOUR-SECOND-DOMAIN.COM YOUR-SUBDOMAIN.YOUR-DOMAIN.COM

( OR )
/root/addons/Plesk/update_chroot.sh --apply all

mv /usr/bin/php /usr/bin/php.YOUR-SECOND.backup

mv /usr/bin/php.backup /usr/bin/php

If you experience any further issues/errors/problems, pls. don't hesitate to ask your questions, but pls. note, that without decent informations about YOUR steps, the corresponding output from your command line when you used a specific command and as well without the information of "php -i" ( to be performed with the domain - system - user, which has access to the chrooted shell! ), it is not really possible to investigate a ( possible ) issue/error/problem.
In addition, pls. note, that you should consider to open a support ticket at => Plesk Admin Services , if you desire further assistance to administrate your server. :)
 
Ok, i did the following:

1. i created the following directory to get it exactly like you did in your structure:
/root/addons/Plesk/

Done with no Problems

2. i downloaded the chroot_update.sh and placed it in this directory

Done with no Problems

3. i made a backup of the actual usr/bin/php file and checked if it was created successfully

Done with no Problems

4. i crated a simlink to the desired php version (in my case php7) in the usr/bin folder

Done with no Problems

5. i wanted to add php to the chroot_update.sh and get the following message:
WARNING: /usr/bin/php is not a programm (filetype inode/symlink; charset=binary). Skipping.

So this step is not working for me. What do i have to do now?
 
Back
Top