Frage

I am trying to setup my first laravel project. I am running XAMPP for Linux (LAMPP) and I installed composer in /opt/lampp/bin/php.

  1. I then cd /opt/lampp/htdocs
  2. I then run: /opt/lampp/bin/php composer.phar create-project laravel/laravel new_proj --prefer-dist
  3. Everything seems to be going great for the install then I get
    • Script php artisan optimize handling the post-install-cmd event returned with an error
    • [Runtime Exception]
    • Error Output: sh: 1: php: not found
  4. I have PHP 5.4.

I think I understand the error but I don't know Laravel well enough to solve this. I have searched for this and can't seem to find an answer.

Also I can't seem to find a good starting point for trying to install this on XAMPP for Linux (LAMPP). Any help here would be greatly appreciated.

War es hilfreich?

Lösung

Problem was that I did not specify

/opt/lampp/bin

in my Path so it could not find PHP and more specifically it could not find the version of PHP that I was using in LAMPP. So I added

Path=$PATH:/opt/lampp/bin

to my ~/.bashrc file then I was able to successfully install laravel. Next issue that came up after that was setting permissions on the appropriate folders.

Permissions Problem, See Below:

  1. Set permission for your project folder:
    sudo chmod 755 -R laravel_proj_name

  2. Set permission for your project storage folder:
    sudo chmod o+w -R laravel_proj_name/app/storage

  3. Refresh Page, Good to Go!

Andere Tipps

I think the problem is that the PHP CLI binary is not in your path. Try adding it to your path or putting a symbolic link into /usr/bin or some other appropriate place.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top