laravel showing error gives failed to open stream: no such file or directory autoload.php - laravel

Im new with laravel and give me error showing: failed to open stream: no such file or directory autoload.php
im using:
windows 8
composer
laravel 5
wampserver
php 5.3

Looks like you're missing vendor/autoload.php and this is probably because when you tried to install laravel, composer threw an error about you trying to use PHP 5.3. Laravel 5 requires at least 5.4.
On a side note PHP 5.3 is end of life and unsupported.

Related

composer require yajra/laravel-oci8:^8 in laravel 8

PHP version 7.3.22
Running on Laravel Framework version 8
root#df77c47e6f1e:/var/www/oracle-laravel-v8# composer require yajra/laravel-oci8:^8
PHP Warning: PHP Startup: Unable to load dynamic library 'oci8_12c' (tried: /usr/lib/php/20180731/oci8_12c (/usr/lib/php/20180731/oci8_12c: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/oci8_12c.so (/usr/lib/php/20180731/oci8_12c.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_oci' (tried: /usr/lib/php/20180731/pdo_oci (/usr/lib/php/20180731/pdo_oci: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/pdo_oci.so (/usr/lib/php/20180731/pdo_oci.so: cannot open shared object file:
No such file or directory)) in Unknown on line 0
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2.0 is about to be released and the older 1.x releases will self-update directly to it once it is released. To avoid surprises update now to the latest 1.x version which will prompt you before self-updating to 2.x.
Run composer self update command and clear composer cache
composer self-update
Then
composer clear-cache
There is nothing wrong about laravel and composer here. It seems that your system's php installation/configuration is wrong (pdo_oci extension is missed or misconfigured) so it can't process anything, even fails at composer startup.
Composer itself is package manager written in php. And laravel is framework written in php. So it's laravel is running on php, not vice versa.

Laravel CLI fails to create new app due to Cannot use lexical variable $eventName as a parameter name

After successful installation of Laravel's install tool using composer using composer global require "laravel/installer" command, the first attempt to create an application by running laravel new app-name fails with the following output, any advice will be appreciated :)
Crafting application...
PHP Fatal error: Cannot use lexical variable $eventName as a parameter name in /Users/ABN/.composer/vendor/guzzlehttp/guzzle/src/Event/Emitter.php on line 48
PHP Stack trace:
PHP 1. {main}() /Users/ABN/.composer/vendor/laravel/installer/laravel:0
PHP 2. Symfony\Component\Console\Application->run() /Users/ABN/.composer/vendor/laravel/installer/laravel:13
PHP 3. Symfony\Component\Console\Application->doRun() /Users/ABN/.composer/vendor/symfony/console/Application.php:126
PHP 4. Symfony\Component\Console\Application->doRunCommand() /Users/ABN/.composer/vendor/symfony/console/Application.php:195
PHP 5. Laravel\Installer\Console\NewCommand->run() /Users/ABN/.composer/vendor/symfony/console/Application.php:878
PHP 6. Laravel\Installer\Console\NewCommand->execute() /Users/ABN/.composer/vendor/symfony/console/Command/Command.php:259
PHP 7. Laravel\Installer\Console\NewCommand->download() /Users/ABN/.composer/vendor/laravel/installer/src/NewCommand.php:52
PHP 8. GuzzleHttp\Client->get() /Users/ABN/.composer/vendor/laravel/installer/src/NewCommand.php:125
PHP 9. GuzzleHttp\Client->createRequest() /Users/ABN/.composer/vendor/guzzlehttp/guzzle/src/Client.php:125
PHP 10. GuzzleHttp\Client->getEmitter() /Users/ABN/.composer/vendor/guzzlehttp/guzzle/src/Client.php:115
PHP 11. spl_autoload_call() /Users/ABN/.composer/vendor/guzzlehttp/guzzle/src/Event/HasEmitterTrait.php:15
PHP 12. Composer\Autoload\ClassLoader->loadClass() /Users/ABN/.composer/vendor/guzzlehttp/guzzle/src/Event/HasEmitterTrait.php:15
PHP 13. Composer\Autoload\includeFile() /Users/ABN/.composer/vendor/composer/ClassLoader.php:322
Turned out the issue is related to the guzzle version installed on the system.
After seeing similar issue reported around guzzle 5.3 on some other repositories/apps, confirmed my globally installed version by running composer global info guzzlehttp/guzzle and it was 5.3.
Then updating my composer's global installation by running composer global updatesolved the problem, after seeing the update report as shown bellow, running the same laravel new app-name generates the application successfully.
Updating guzzlehttp/guzzle (5.3.0 => 6.2.3): Downloading (100%)
This is related to Guzzle's PHP 7.x incompatibility and this has been fixed in Guzzle >=5.3.1.
The solution is to upgrade your Guzzle by modifying line in your composer.json file to:
"guzzlehttp/guzzle": "~5.3.1",
or:
"guzzlehttp/guzzle": "~5.3#stable",

what is the solution for php_mysql.dll ext in laravel with php 7 and IIs7

I am using laravel latest framework (5.3.*) with IIS7 and php7. It is showing a warning for create project or any artisan command like
c:\inetpub\wwwroot\test>php atisan serve PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ v7.0\ext\php_mysql.dll' - %1 is not a valid Win32 application. in Unknown on line 0
I want to create my project with latest version of php and laravel but with php7 the php_mysql.dll is deprecated. How can I prevent the warning of php_mysql.dll?
Did you copy php.ini from a previous installation of PHP 5.x? It looks like you have copied the extensions and php.ini from a previous installation of PHP 5, compiled with a different version of VC or 32/64bit.
To solve the issue, you should just need to open your php.ini, and comment out or remove the line:
extension=php_mysql.dll

Laravel server hosting error

I had built my website using Laravel 4, and it works fine on localhost but when I host it in my online webserver I've got this error:
Parse error: syntax error, unexpected T_USE, expecting T_FUNCTION in /home/.../public_html/bootstrap/compiled.php on line 3242
How can I get rid of this error?
Laravel 4.2 requires PHP 5.4+, make sure you have that.
If you updated from an earlier version of Laravel and on PHP 5.4+, remove public_html/bootstrap/compiled.php and it should work again.
If you can't use 5.4+, use Laravel 4.1 instead of 4.2, so in your composer.json you want "laravel/framework": "4.1.*", instead of what you have now.

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.

Resources