Summary
To install latest Laravel ver.11 on xserver, I needed to switch php cli ver. to the latest
(at least to cli ver8.2). Here are some tips what I found.
Points
Symbolic Link needs to select the absolute path(/opt/php-8.2.22/bin/php)
Steps
- Check php path by
ls -la
, basically it will be on /opt/php...
rwxrwxrwx 1 root root 27 9月 3 10:45 php-fcgi8.2 -> /opt/php-8.2.2/bin/php
- Set that symbolic link
ln -s /opt/php-8.2.2/bin/php $HOME/bin/php
.vi ~/.bash_profile
- Change
PATH=$PATH:$HOME/bin to PATH=$HOME/bin:$PATH
- Execute
source ~/.bash_profile
- Run php -v to check new version.
- Run
laravel new <ProjectName>
to install latest laravel. now it worked.
Failure
I set the sybolic link below but it failed because it was not the resource file.
ln -s /usr/bin/php-8.2 $HOME/bin/php
Correct link is
ln -s /opt/php-8.2.22/bin/php $HOME/bin/php
Tips
IF already existed the symbolic link, do below to unlink.
unlink /home/<username>/bin/php