PHP 8.3 Working on Browser via phpinfo() but Terminal Shows Error

Hello,

I recently set PHP to version 8.3 on my CyberPanel server. To verify, I created an index.php file with the phpinfo() function, and when accessed via browser, it correctly shows that PHP 8.3 is installed and active.

However, when I try to run php -v or execute any PHP script from the terminal/CLI, I encounter an error or a different PHP version is shown.

Is there a way to ensure the terminal uses PHP 8.3 as well? How can I make sure both the web server and CLI are using the same PHP version?

I also followed the instructions in this guide for deploying a Laravel application on CyberPanel:
:link: How to deploy a Laravel project on CyberPanel

Thanks in advance!

1 Like

@shoaibkk
Can you please look into this issue?

I created a custom DEVELOPER role and gave it all permissions needed to work on websites, db, dns, etc. Basically, didn’t give it all permissions, like admin role.

Now the user is assigned to the developer role. We are trying to create Laravel/PHP projects. We followed these articles:

The deployment requirement composer which requires PHP. We set php 8.3 when creating the site. However, running php -v is not working on the terminal with the app’s account created by Cyerpanel.

Any help on this issue is highly appreciated.