laravel 4 install issue when using composer install - laravel

When I run
composer.phar install
I get this error almost at the end of the installation, any ideas?
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/belendez/public_html/laravel/artisan on line 46
Parse error: syntax error, unexpected T_STRING in /home/belendez/public_html/laravel/artisan on line 46
Script php artisan optimize handling the post-install-cmd event returned with an error
I look into the suggested link and it appears that somehow in the middle of the installation it changes from 5.3 to 5.2! If I try to start installation using 5.2 it returns right a way: class 'Phar' not found. Any ideas?

It seems that issuing only a php command will pick up another version of the interpreter. Try to change all the references to php in your composer.phar file to the one you want actually to be executed (in your case it seems /opt/php53/bin/php).
You can confirm that by simply launching a php -v directly from the command line to see what version your server will pick up

Related

How to configure the Laravel built-in web server?

I am running this command:
C:\xampp\htdocs\notebook>php artisan serve
However I get this error:
Warning: require(C:\xampp\htdocs\notebook\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\notebook\bootstrap\autoload.php on line 17
Fatal error: require(): Failed opening required 'C:\xampp\htdocs\notebook\bootstrap/../vendor/autoload.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\notebook\bootstrap\autoload.php on line 17
After creating a project or cloning existing one you should run composer install command which will install all dependecies and will create autoload.php file.
That is an import error.
Everytime you have one of these, you should try to run composer dump-autoload.
Most of the time, this command will fix your imports.
It looks like you might not have installed the required dependencies yet. You should do so using the composer package manager, like so:
C:\ProgramData\ComposerSetup\bin\composer install

Fresh CentOS 7, first Laravel Installation.Composer install breaks

I am fallowing this tutorial:
http://linoxide.com/linux-how-to/install-laravel-php-centos-7-ubuntu-15-04/
And on step 5) when running composer install in the project directory it starts to do staff, as expected, until this happened:
Illuminate\Foundation\ComposerScripts::postInstall
> php artisan optimize
PHP Fatal error: Undefined constant 'Illuminate\Session\TokenMismatchException' in /var/www/laravel-develop/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 779
PHP Fatal error: Undefined constant 'Illuminate\Session\TokenMismatchException' in /var/www/laravel-develop/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 779
Script php artisan optimize handling the post-install-cmd event returned with error code 255
What is the problem?
Thanks, Aleks
start creating a project (after updating composer) instead of downloading the referenced file do the following
from your terminal type in cd /var/www/
then type composer create-project laravel/laravel laravel-develop
your composer should download the latest version of Laravel
try it this way feel free to ask any questions.
Good Luck

Composer error installing laravel-cors

I tried to install laravel-cors
composer require barryvdh/laravel-cors
It installed successfully or so I thought, but then when I went to publish the config I get this error:
[RuntimeException]
Error Output: PHP Fatal error: Cannot redeclare Composer\Autoload\includeFile() (previously declared in /www/vendor/composer/ClassLoader.php:410) in /www/config/vendor/composer/ClassLoader.php on line 413
I have tried removing laravel-cors and I still get this error. I have dumped autoload as well. What am I missing?
Larval 5.2 | PHP 5.6.17
I figured it out. When i typed
composer require barryvdh/laravel-cors
i was in a sub directory. so composer then installed it and the dependencies in a sub directory which is why i was getting that error. If you look closely you can see that it was installing in config
/www/config/vendor/composer/ClassLoader.php:413
/www/vendor/composer/ClassLoader.php:410
Just needed to pay better attention to detail.

unable to run laravel 4

I thought it was about time to look at a PHP Framework so I chose laravel. However, getting it running is causing me grief.
I followed the video from nettuts installing laravel 4 and at 5.05mins into the video he uses the php command-line server command (available from 5.4) php -S localhost:8888 -t public/ followed by confirming that it works via localhost:8888 in the browser which displays 'Hello Wolrd!'
I have XAMPP installed and my version of PHP is 5.3.15. I attempted to test it by doing http://localhost/learning-laravel/public/
At this point I have already downloaded composer and installed the dependancies successfully.
But I keep getting the following error:
Warning: require(/Applications/XAMPP/xamppfiles/htdocs/learning-laravel/bootstrap/../vendor/autoload.php) [function.require]: failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/learning-laravel/bootstrap/autoload.php on line 17
Fatal error: require() [function.require]: Failed opening required '/Applications/XAMPP/xamppfiles/htdocs/learning-laravel/bootstrap/../vendor/autoload.php' (include_path='.:/Applications/XAMPP/xamppfiles/lib/php:/Applications/XAMPP/xamppfiles/lib/php/pear') in /Applications/XAMPP/xamppfiles/htdocs/learning-laravel/bootstrap/autoload.php on line 17
Inside my learning-laravel folder I do have bootstap/autoload.php
Can someone please help? Thanks.
I had another look at my folder structure and I noticed that composer had not run correctly and there were missing files. I've reinstalled it and it appears to be working.

Laravel 4 - php artisan migrate error

when I run php artisan migrate I receive this error:
Fatal error: Call to undefined function J20\Uuid\openssl_random_pseudo_bytes() i n C:\xampp\htdocs\blog\Laravel-4-Bootstrap-Starter-Site\vendor\j20\php-uuid\src\ J20\Uuid\Uuid.php on line 32
I'm trying to install this app, https://github.com/andrew13/Laravel-4-Bootstrap-Starter-Site
I appreciate any help, since I have no idea how to deal with something in the vendor dir halting migrations.
Make sure you enable the openssl extension in your PHP.ini file by removing the comment from the following line.
;extension=php_openssl.dll
So that it looks like this.
extension=php_openssl.dll
Then restart Apache to make sure the changes take effect.

Resources