Dikanio's avatar

Artisan command on cpanel

Hi, i use jasonlewis\resource-watcher package to detect a presence of new file in storage, so everytime new file is created in storage/public i can detect it and move it to another folder, the package is working fine on localhost but i need to run it on cpanel, to start the package in localhost i simply use 'php artisan watcher' but how do i run it on cpanel, so it can work on background. If it's impossible to run it on cpanel is there another way i can detect a new file and move it to another folder

thanks

0 likes
6 replies
Shahrukh4's avatar
Level 4

Actually in Cpanel no commands for php and composer related run because everytime you upload your projects on Cpanel you have to compile it down in your local and then upload it.

Alternatively, get the SSH access from your Cpanel and after successful SSH login try running your various artisan commands you want.

5 likes
afridi's avatar

@SHAHRUKH4 - @shahrukh4 Agree to you that SSH is good choice to do that. But I have seen shared hosting has terminal in cPanel and I did run the command, but I have a VPS with WHM installed, I enabled the terminal for my cPanel and when I type php artisan inside my root, I see no effect.

So if you know how to enable it please let me know. If a shared hosting has this functionality enabled, then there should be a solution inside VPS, because in VPS we have more access. I have unmanaged vps so I can't ask to the provider.

sirdoro1's avatar

I had similar issue! How I fixed it was I changed PHP Version in cpanel to PHP v7.3. which was currently in PHP v5.6. I hope this help.

1 like
Monjur ajad's avatar

cpanel->select version php ->version choice right side menu->then checked and apply

Please or to participate in this conversation.