I have a project that I need to edit. To see this project, I wanted to run it on localhost and ran it from wamp. Later, when I entered localhost, I got the error.
On top of that, I wanted to run it from cmd and see it. The response I got at that time was as follows.
Fatal error: Uncaught Error: Failed opening required 'C:\wamp64\www/vendor/autoload.php' (include_path='.;C:\php\pear') in C:\wamp64\www\artisan:18
Stack trace:
#0 {main}
thrown in C:\wamp64\www\artisan on line 18
check if there is any /vendor/autoload.php file in your wamp folder if not try composer install in the terminal where your project is located. (if you don't have composer install the composer first via this url)
you can start your project directly with php artisan serve too. if php is added to your windows path variables.
Related
The error it gives is
Warning: require_once(header.php): Failed to open stream: No such file
or directory in C:\xampp\htdocs\test4\public\index.php on line 1
Fatal error: Uncaught Error: Failed opening required 'header.php'
(include_path='C:\xampp\php\PEAR') in
C:\xampp\htdocs\test4\public\index.php:1 Stack trace: #0
C:\xampp\htdocs\test4\server.php(21): require_once() #1 {main} thrown
in C:\xampp\htdocs\test4\public\index.php on line 1
note there is no index.php file in cPanel but its run but its not run on xampp localhost and throw error
In order to run the laravel files you have to follow a few steps:
Delete the vendor folder which contains the dependencies
Open up a command prompt in the same folder and run composer install to re-install the dependencies
Then open the .env file and update the database credentials
Type this command : php artisan migrate to migrate your database
Finally run php artisan serve to serve the laravel application.
I'm trying to include and use Markdownify in my PHP script on a local server in windows 10, but it does not work.
I have WAMP64 server installed, on which I run my PHP files locally.
I've downloaded Composer and installed it.
During Composer installation I picked php.exe from my WAMP64 server when prompted.
In a CMD I have then entered "composer require pixel418/markdownify", the command was recognized and completed.
Now I try to define in my PHP code:
$converter = new Markdownify\Converter;
but it does not work. Instead I get the error message:
Fatal error: Uncaught Error: Class 'Markdownify\Converter' not found in D:\wamp64\www\mysite\investigate.php:16 Stack trace: #0 {main} thrown in D:\wamp64\www\mysite\investigate.php on line 16
Any hint on how to make this work?
You need to add these lines in your script so PHP knows where to get the classes from
namespace Markdownify;
use Markdownify\Converter;
I've been googling this for half an hour and nothing's working. I've got PHP added to my windows path variable, and everytime I run this:
php composer.phar install --no-dev --optimize-autoloader
I get this
Fatal error: Uncaught exception 'PharException' with message 'unable to open phar for reading "composer.phar"' in composer.phar:23
Stack trace:
#0 composer.phar(23): Phar::mapPhar('composer.phar')
#1 {main}
thrown in composer.phar on line 23
I'm CD'd into the folder it's in, I've tried specifying that folder in the command, nothing's working, neither does
php -r "readfile('https://getcomposer.org/installer');" | php
edit: Ok I signed out and back in after trying the windows exe installer, seems it's installed now but only globally, I still don't have the vendor/bin directory I need in my specific project, still fails when I try and run php composer.phar install
I am trying to int Zend framework 2. I aready have xampp running. I followed the steps on this answer. How ever when I visit the url I specified I get the following descriptive error:
Fatal error: Uncaught exception 'RuntimeException' with message 'Unable to load ZF2. Run php composer.phar install or define a ZF2_PATH environment variable.' in C:\xampp\htdocs\ZendSkeletonApplication\init_autoloader.php:51 Stack trace: #0 C:\xampp\htdocs\ZendSkeletonApplication\public\index.php(18): require() #1 {main} thrown in C:\xampp\htdocs\ZendSkeletonApplication\init_autoloader.php on line 51
as the exception states. I went on to run the command php composer.phar install
and nothing happens. nothing displays on th cli to showing anything being installed. and when i run again application i get the same error. Where else can I look and check for errors. Thanks
I am using PHP Version 5.6.8
So what worked for me. I began again from scratch following the tutorial here
Then I still got a "could not open input file: composer.phar" when I ran the command: php composer.phar install
so according to "www.softanalyst.com/zend-2-framework-installation-with-xampp/#comment-883" I need to run the following command:
php -r "readfile('https://getcomposer.org/installer');" | php
which I did and it all worked.
open up your terminal and move To your project using the cd project directory
one type dir composer.phpr and try this one dir composer.json if both file listed than do the next step otherwise download the composer in current directory and run the following command as bellow.
php composer.phar install this comman will install all required dependency from the composer.json file. it will take time as depend on internet speed.
once it's complete than try this link for further steps.this link also having how To install composer And skeleton application.
Github
Twitter
I ran composer install --no-dev before having to manually deploy to a client's server by FTP that lacks SSH access. When I did so, I received the following error:
PHP Fatal error: Class 'Way\Generators\GeneratorsServiceProvider' not found in C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php on line 158
PHP Stack trace:
PHP 1. {main}() C:\www\test.dev\laravel\artisan:0
PHP 2. require_once() C:\www\test.dev\laravel\artisan:30
PHP 3. require() C:\www\test.dev\laravel\bootstrap\start.php:60
PHP 4. Illuminate\Foundation\ProviderRepository->load() C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\start.php:210
PHP 5. Illuminate\Foundation\ProviderRepository->compileManifest() C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php:58
PHP 6. Illuminate\Foundation\ProviderRepository->createProvider() C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php:122
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class 'Way\\Generators\\GeneratorsServiceProvider' not found","file":"C:\\Ampps\\www\\test.dev\\laravel\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\ProviderRe
pository.php","line":158}}Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
[RuntimeException]
Error Output: PHP Fatal error: Class 'Way\Generators\GeneratorsServiceProvider' not found in C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php on line 158
PHP Stack trace:
PHP 1. {main}() C:\www\test.dev\laravel\artisan:0
PHP 2. require_once() C:\www\test.dev\laravel\artisan:30
PHP 3. require() C:\www\test.dev\laravel\bootstrap\start.php:60
PHP 4. Illuminate\Foundation\ProviderRepository->load() C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\start.php:210
PHP 5. Illuminate\Foundation\ProviderRepository->compileManifest() C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php:58
PHP 6. Illuminate\Foundation\ProviderRepository->createProvider() C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php:122
Each of the app.php files has the line 'Way\Generators\GeneratorsServiceProvider'.
This was working fine before running that composer command. Why did this happen and how can it be fixed?
Laravel 4.1.
In your composer.json file, you have way/generators as a development machine dependency only. If you have the service provider 'Way\Generators\GeneratorsServiceProvider' in each of the app.php file, then it would mean that way/generators is a development machine as well as the deployment machine dependency. By doing composer install --no-dev, you're saying that the packages that are development machine dependency only, shouldn't go in the vendor directory, which means that the package way/generators is not installed in the vendor directory. That's why you're getting the error.
Since way/generators is a development dependency only, you should remove 'Way\Generators\GeneratorsServiceProvider' from app/config.php, so that the deployment machine wouldn't look for it.
Also if you're working on the development machine and performed composer install --no-dev, the way/generators package wouldn't be installed in the vendor directory and you'd get the above error. So you'd have to make the development machine environment as not local to test whether or not it'd work in the deployment machine.