Installing the cli version of php wont be enough if you actually want to use this beyond development, you need to install as an apache module. There also doesn't seem to be a specific cli package on opensuse which is why you are getting this error.
php artisan serve
is intended just for development purposes, it uses the inbuit php web server, which for many reasons should note be used on production servers (those used by actual users, available on the internet or even a private network).
The reason it's erroring is the php binary is not in your path - if you specify the full path it would run: /opt/lampp/bin/php artisan serve
You could add this to your path - this question/answer covers how to do this well: https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path
You probably want to edit your ~/.profile
file by editing or adding the following line PATH=$PATH:/opt/lampp/bin/
which would mean any commands inside /opt/lamp/bin/ would work without the full path needing to be entered each time.
Try sudo apt-get install php5
This tutorial should walk you through all the steps.
Also worth noting there is now php7 - are you specifically installing the older version for a reason?
Try sudo apt-get install php7
There are a number of modules which you may also require, you can see available packages on opensuse website
From comments it sounds like you will need openssl and phar at least, these can be installed like so:
sudo apt-get install php7-openssl php7-phar
Looking at the requirements for laravel
- PHP >= 5.6.4
- OpenSSL PHP Extension
- PDO PHP Extension
- Mbstring PHP Extension
- Tokenizer PHP Extension
- XML PHP Extension
You will also need to run:
sudo apt-get install php7-pdo php7-mbstring php7-tokenizer php7-xml
Regarding composer you should be able to get this installed by running
/opt/lampp/composer.phar install
If this doesn't solve it for you then this question should provide you with various options to try: