Reputation: 463
I'm new to Laravel so you may have to bear with me, but I seem to be having a small issue. Now first of all I've created a basic template and managed to get it to run using phpMyAdmin with Wamp and it worked fine. I've also been given an old project that I've been asked to take a look at but for some reason I can't get it to run.
So this is the process I'm using:
1: Opened cmd change to the correct directory
2: Install the composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
3: Change directory to the project directory
4: Run php artisan key:generate
ERROR:
PHP Warning: require(C:\wamp64\www\pmanager\websiteprojectNew\websiteproject\vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php): failed to open stream: No such file or directory in C:\wamp64\www\pmanager\websiteprojectNew\websiteproject\vendor\composer\autoload_real.php on line 54
Warning: require(C:\wamp64\www\pmanager\websiteprojectNew\websiteproject\vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php): failed to open stream: No such file or directory in C:\wamp64\www\pmanager\websiteprojectNew\websiteproject\vendor\composer\autoload_real.php on line 54 PHP Fatal error: require(): Failed opening required 'C:\wamp64\www\pmanager\websiteprojectNew\websiteproject\vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php' (include_path='C:\xampp\php\PEAR') in C:\wamp64\www\pmanager\websiteprojectNew\websiteproject\vendor\composer\autoload_real.php on line 54
Fatal error: require(): Failed opening required 'C:\wamp64\www\pmanager\websiteprojectNew\websiteproject\vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php' (include_path='C:\xampp\php\PEAR') in C:\wamp64\www\pmanager\websiteprojectNew\websiteproject\vendor\composer\autoload_real.php on line 54
C:\wamp64\www\pmanager\websiteprojectNew\websiteproject>php artisan migrate PHP Warning: require(C:\wamp64\www\pmanager\websiteprojectNew\websiteproject\vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php): failed to open stream: No such file or directory in C:\wamp64\www\pmanager\websiteprojectNew\websiteproject\vendor\composer\autoload_real.php on line 54
Warning: require(C:\wamp64\www\pmanager\websiteprojectNew\websiteproject\vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php): failed to open stream: No such file or directory in C:\wamp64\www\pmanager\websiteprojectNew\websiteproject\vendor\composer\autoload_real.php on line 54 PHP Fatal error: require(): Failed opening required 'C:\wamp64\www\pmanager\websiteprojectNew\websiteproject\vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php' (include_path='C:\xampp\php\PEAR') in C:\wamp64\www\pmanager\websiteprojectNew\websiteproject\vendor\composer\autoload_real.php on line 54
Fatal error: require(): Failed opening required 'C:\wamp64\www\pmanager\websiteprojectNew\websiteproject\vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php' (include_path='C:\xampp\php\PEAR') in C:\wamp64\www\pmanager\websiteprojectNew\websiteproject\vendor\composer\autoload_real.php on line 54
Updated error after installing Git
Warning: require(C:\wamp64\www\websiteprojectNew\websiteproject\vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php): failed to open stream: No such file or directory in C:\wamp64\www\websiteprojectNew\websiteproject\vendor\composer\autoload_real.php on line 54
Fatal error: require(): Failed opening required 'C:\wamp64\www\websiteprojectNew\websiteproject\vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php' (include_path='C:\xampp\php\PEAR') in C:\wamp64\www\websiteprojectNew\websiteproject\vendor\composer\autoload_real.php on line 54 PHP Warning: require(C:\wamp64\www\websiteprojectNew\websiteproject\vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php): failed to open stream: No such file or directory in C:\wamp64\www\websiteprojectNew\websiteproject\vendor\composer\autoload_real.php on line 54 PHP Fatal error: require(): Failed opening required 'C:\wamp64\www\websiteprojectNew\websiteproject\vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php' (include_path='C:\xampp\php\PEAR') in C:\wamp64\www\websiteprojectNew\websiteproject\vendor\composer\autoload_real.php on line 54 Script php artisan clear-compiled handling the pre-update-cmd event returned with error code 255
Composer Install Command Output:
Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them. Package operations: 51 installs, 0 updates, 0 removals - Installing golonka/bbcodeparser (v2.1.0): Downloading (failed) Failed to download golonka/bbcodeparser from dist: The "https://api.github.com/repos/golonka/BBCodeParser/zipball/d597b1c0a6472ff7003776dd5c74e084270da041" file could not be downloaded (HTTP/1.1 404 Not Found) Now trying to download from source - Installing golonka/bbcodeparser (v2.1.0): Cloning d597b1c0a6
[RuntimeException] Failed to clone https://github.com/golonka/BBCodeParser.git, git was not found, check that it is installed and in your PATH env.
'git' is not recognized as an internal or external command,
operable program or batch file.install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] []...
Composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"illuminate/html": "^5.0",
"golonka/bbcodeparser": "~2.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"myproject\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
Upvotes: 0
Views: 971
Reputation: 3160
According to your errors there are two reason this could happen.
No git installed
'git' is not recognized as an internal or external command, operable program or batch file.
to resolve this install git and see whether git commands working on the console
You have added deleted packages
Failed to clone https://github.com/golonka/BBCodeParser.git, git was not found, check that it is installed and in your PATH env.
see whether there's a package called golonka/bbcodeparser
in our composer.json and delete it
after resolving these two run composer install
in your project folder see whether its working or not. after that you can run php artisan key:generate
Upvotes: 0