今天要在服務(wù)器上執(zhí)行寫好在laravel的定時(shí)文件
命令? crontab -e
添加? * * * * * php? /項(xiàng)目路徑/artisan schedule:run
我在定時(shí)任務(wù)里寫上一條
file_put_contents('0522.txt' , var_export('99999' , true), FILE_APPEND);
一分鐘過(guò)去了? 根目錄下并沒(méi)有這個(gè)txt
于是我在項(xiàng)目下執(zhí)行? php artisan schedule:run
出現(xiàn)錯(cuò)誤
*[Symfony\Component\Process\Exception\RuntimeException]?
The Process class relies on proc_open, which is not available on your PHP installation. *
cd /usr/local/php/etc
vim php.ini并搜索disable_functions指令
disable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_get_status,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server
找到proc_open并刪除
重啟?
繼續(xù) php artisan schedule:run
出現(xiàn)類似上面的錯(cuò)誤 不過(guò)換成了 proc_get_status
刪除
重啟
執(zhí)行成功