Openshift - PHP Fatal error: require(): Failed opening required - php

I want to push my php(laravel) project to openshift but I get the following errors from git bash:
This is what I did:
Created a brand new laravel application from openshift's website
Cloned the app to my local machine
Made some changes
Committed
Pushed
This is what I get when I attempt to access my url:
Any suggestions?

the vendor folder was not committed. Check your .gitignore you will notice that the vendor folder is ignored

Related

How can I run this PHP website and host it on HostGator?

My friend, who just started a company, sent me this website (https://github.com/lexaugustin/bamboufacile) that someone built for him out of a PHP template, so I can host it for him on "hostgator.com". When I run the public folder with XAMPP, I only see the template website, and when I try to run the server.php that is in the root directory, I get these two errors:
1) "Warning: require(/opt/lampp/htdocs/public/../vendor/autoload.php): failed to open stream: No such file or directory in /opt/lampp/htdocs/public/index.php on line 24
2) Fatal error: require(): Failed opening required '/opt/lampp/htdocs/public/../vendor/autoload.php' (include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/public/index.php on line 24.
Can someone help me run this file and tell me how to host PHP website on hostgator, please? The tutorials on hostgator haven't worked for me.
The project link you have mentioned is a laravel project. The error shows it has missing dependencies. So first thing you will need to install composer to install its dependencies.
Once you are done with the installation open command line and cd to your project directory in xampp htdocs. Run this below command to install the dependencies. Also you will need minimum php 7.1.3 in your xampp and hostgator to run this project.
composer install

symfony post deployment error

i developed web site with symfony 3 and upload it on a server but when i try to access to config.php file i have this error
Fatal error: require(): Failed opening required '/homepages/26/d729697492/htdocs/Media/vendor/composer/../symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php' (include_path='.:/usr/lib/php7.0') in /homepages/26/d729697492/htdocs/Media/vendor/composer/autoload_real.php on line 66
and don't understand i search everywhere no good answer .
i just delete all my files on server and after re-upload all my files without vendor directory and after i install all my dependencies via composer install it works. thank

Symfony 3.3 built-in server error

I'm developping an app under windows 10 + wamp + php 7 + Symfony 3.3
I'm trying to use the built-in server :
php bin/console server:run
[OK] Server listening on http://127.0.0.1:8000
// Quit the server with CONTROL-C.
And when I go to http://localhost:8000/app_dev.php/ or http://127.0.0.1:8000/app_dev.php
I get this error :
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'C:\wamp\www\myproject\vendor\symfony\symfony\src\Symfony\Bundle\WebServerBundle/Resources/router.php' (include_path='.;C:\php\pear') in Unknown on line 0
Same error under every routes. My routes are correct and works fine outside of the built-in server...
Can you help me with this issue please ?
I had same problem,
Solved by :
Delete symfony folder in vendor
composer update
If you have antivirus (like Avast) disable it before launching web
server
php bin/console server:run
I got the same error, even when installing via composer.
It turns out that for whatever reason when composer downloaded the project, the required file listed in the error you get (vendor\symfony\symfony\src\Symfony\Bundle\WebServerBundle/Resources/router.php) was not included...
To fix this, I manually added it from https://github.com/symfony/web-server-bundle/blob/master/Resources/router.php and then my symfony app worked as expected.
I had to restart my computer in order to actually add the file because somehow I was locked out of adding it even as admin in Windows after launching the php server.
UPDATE:
Even better than manually adding the file, I just deleted the symfony folder from the vendor folder in the project and reran composer update. the router.php file is indeed downloaded. Sometimes when running bin/console server:run it gets deleted. Not sure why.
It happened to me when upgrading from Symfony 3.1 to Symfony 3.4.
The reason was that I had left the development server running when I executed the command:
composer update
The solution:
Delete the contents of vendor folder
Execute composer update
Install the new Symfony development server bundle (follow the instructions)
Execute the server for development in a new port
php bin/console server:start localhost:3421
I had this problem too : it was AVAST that blocked the "router.php" file.
I went into avast -> protection -> quarantine, and put an exception of the router.php file
And then everything worked again
I get the same error and I solve this issue by installing the project with composer
composer create-project symfony/framework-standard-edition my_project_name

Why am I getting this error message after I obtained my Laravel project from my GIT repository?

I am new in Laravel and I have the following problem.
I developed a Laravel 5 project on an old computer, and I put the code on a GIT repository. I retrieved my source code on my new laptop from the repository.
But I am facing problems while running the Laravel project on Apache and I am obtaining this error message on my Laravel website instead:
Warning: require(C:\xampp\htdocs\HotelRegistration\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\HotelRegistration\bootstrap\autoload.php on line 17
Fatal error: require(): Failed opening required 'C:\xampp\htdocs\HotelRegistration\bootstrap/../vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\HotelRegistration\bootstrap\autoload.php on line 17
The C:\xampp\htdocs\HotelRegistration\bootstrap\autoload.php is present in my project
Why am I facing this issue? What is the problem? What am I missing? How can I fix this issue? How can I try to solve this issue?
You need to run
composer install
command to install packages. By default vendor directory is ignored when committing to GIT (this is good) so if you pull data from repository you need to install all packages running above command.

Deploy CakePHP 3 on Heroku fails to compile due to "failed to open dir"

I'm using Heroku that I've connected to my github repo (link). I'm trying to deploy the project via the dashboard, but whatever I do I get "Failed to open dir: No such file or directory" as an end result, failing the deploy.
Here's an excerpt from the build log:
> Generating optimized autoload files
> Cake\Composer\Installer\PluginInstaller::postAutoloadDump
> App\Console\Installer::postInstall
Script App\Console\Installer::postInstall handling the post-install-cmd event terminated with an exception
[ErrorException]
scandir(/tmp/build_96b54691e642650c17d8c1d0b7d2f0a9/Sobient-dosspirit2-5e84585/tmp): failed to open dir: No such file or directory
The complete build log
Here's the complete build log output: https://gist.github.com/anonymous/021ecb02d731cdc9e394
Screenshot
Here's a screenshot from the Heroku dashboard showing some of the build log and error:
I've read on other similar questions on StackOverflow that one should move any requirements from require-dev onto require, which I've done. You can see the composer.json file this project uses here: https://gist.github.com/anonymous/63f5158156e10d51e6f6
Is there an issue with the composer.json file or a bug with build stacks on Heroku for PHP-apps using Composer?

Categories