crontab e php

Issues related to applications and software problems and general support
Post Reply
morph3us
Posts: 1
Joined: 2016/03/08 08:45:49

crontab e php

Post by morph3us » 2021/07/23 15:56:39

Buonasera,
ho un problema di questo tipo, con la schedula di un comando:

/usr/bin/php /var/www/html/scalare/mailScalare.php >> /var/log/controllaScalare.log

ottengo questo errore:

PHP Warning: require(/vendor/autoload.php): Failed to open stream: No such file or directory in /var/www/html/scalare/mailScalare.php on line 12
PHP Fatal error: Uncaught Error: Failed opening required '/vendor/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php:/usr/share/pear:/usr/share/php') in /var/www/html/scalare/mailScalare.php:12

lo script php lanciato da web funziona correttamente ma da console si 'arrabbia'

sapete darmi una dritta?


Grazie
F

scottro
Forum Moderator
Posts: 2556
Joined: 2007/09/03 21:18:09
Location: NYC
Contact:

Re: crontab e php

Post by scottro » 2021/07/23 17:14:36

Please note that this is an English only forum and that I've never seen anyone here make fun of another poster's English. So please use English in the future, even if you have to use google translate.

Anyway, running this through google translate, I get.
I have a problem like this, with the scheduling of a command:
i get this error:

Code: Select all

PHP Warning: require(/vendor/autoload.php): Failed to open stream: No such file or directory in /var/www/html/scalare/mailScalare.php on line 12
PHP Fatal error: Uncaught Error: Failed opening required '/vendor/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php:/usr/share/pear:/usr/share/php') in /var/www/html/scalare/mailScalare.php:12
the php script launched from the web works correctly but from the console it gets 'angry'

can you give me a tip?
New users should check the FAQ and Read Me First pages

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: crontab e php

Post by TrevorH » 2021/07/23 17:23:53

I'd guess there's some variable in the code that is not set when run from the command line.

Try grep -ir autoload.php /var/www/html/scalare/ and see if the line of code actually says something like 'require($SOMEPATH/vendor/autoload.php[/tt] and if so then set the correct variable.

Or maybe you're not meant to invoke it that way and you're doing it wrong. Sounds like a question for whoever wrote 'scalare'.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply