Cache access issue while installing preproduction on symfony - php

I am currently trying to install a preproduction branch on my dedicated serveur.
I installed a Symfony version in the /web/preprod directoty of my symfony production project. I managed to link correctly the front controller and the routes, and now I am calling an action in the preprod branch.
I am getting this error message :
Warning:
require_once(/var/www/vhosts/ns21206.ovh.net/citydom/web/preprod/app/cache/prod_new/jms_diextra/proxies/CityDom-APIBundle-Controller-GangController.php):
failed to open stream: No such file or directory in
/var/www/vhosts/ns21206.ovh.net/citydom/web/preprod/app/cache/prod/jms_diextra/controller_injectors/CityDomAPIBundleControllerGangController.php
on line 13
Fatal error: require_once(): Failed opening required '/var/www/vhosts/ns21206.ovh.net/citydom/web/preprod/app/cache/prod_new/jms_diextra/proxies/CityDom-APIBundle-Controller-GangController.php'
(include_path='.:/usr/share/pear:/usr/share/php') in
/var/www/vhosts/ns21206.ovh.net/citydom/web/preprod/app/cache/prod/jms_diextra/controller_injectors/CityDomAPIBundleControllerGangController.php
on line 13
The preprod cache folders are on permission 777.
Not all action aren't working, but this one doesn't.

See Setting up Permissions in this section. Go with the setfacl command.

Related

autoload.php missing when its there

I have started a new Laravel Project and wanted to test it on my localhost...
When I view the site I get an error message saying:
Warning:
require(C:\xampp\htdocs\public/../Website/vendor/autoload.php): failed
to open stream: No such file or directory in
C:\xampp\htdocs\Website\public\index.php on line 24 Fatal Error:
require(): Failed opening required
'C:\xampp\htdocs\Website\public/../Website/vendor/autoload.php'
(include_path='C:\xampp\php\PEAR') in
C:\xampp\htdocs\Website\public\index.php on line 24
I looked it up, but I found the autoload.php file in all folders and I already tried composer update --no-scrips. I just don't get why it isn't loading the project.
'Website' is the name of my Laravel project folder btw.
I fixed the problem thanks to apokryfos.
In the autoload file the DIR.'/../vendor/autoload.php' was changed to DIR.'/../Website/vendor/autoload.php' which was the wrong path. I don't know how this could happen, but simply deleting the 'Website/' seemed to fix the problem.
Thanks again to apokryfos.
Turns out I didn't enable openssl in my php.ini so when I created my new project with composer it was installed from source. I changed that and ran
composer update
now the vendor folder was created

Repo not working in localhost using laravel

I am new to this but I am trying to view a repository through localhost and I am receiving this php error in the mamp log:
PHP Warning: require ..... failed to open stream: No such file or directory in .......autoload_real.php on line 58
PHP Fatal error: require(): Failed opening required
....autoload_real.php on line 58
On Line 58 is the following:
function composerRequireec02cd7cea0c14cd8638fe929f5e7e81($file)
{
require $file;
}
I think it might have something to do with the laravel version but i'm not sure. The other thing is that when I try to see errors in the laravel log there is no log in app/storage
First give the read permission to storage and bootstrap directory in your laravel project and then reload your laravel project in browser.
It seems to work now after doing composer-dump autoload then a composer update, although I was looking for more of a global answer as to why this might be happening (i.e. outdated laravel version etc.). But thanks everyone!

Symfony2 deploy failure vendor/autoload.php

I have deployed a Symfony2 application to shared hosting server from local machine. I used a git pull followed by composer install and then i chmoded the app/cache and app/logs permissions to 777.
Each time I run the application I get the following error:
[2016-02-06 18:55:43] request.CRITICAL:
Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalErrorException:
"Compile Error: require(): Failed opening required 'vendor/autoload.php'
(include_path='.:/opt/alt/php55/usr/share/pear:/opt/alt/php55/usr/share/php')" at
/home/tdarlic/public_html/magniblu/users/src/AppBundle/Controller/DefaultController.php line 5 {"exception":"[object]
(Symfony\Component\Debug\Exception\FatalErrorException(code: 0): Compile
Error: require(): Failed opening required 'vendor/autoload.php'
(include_path='.:/opt/alt/php55/usr/share/pear:/opt/alt/php55/usr/share/php') at /home/tdarlic/public_html/magniblu/users/src/AppBundle/Controller/DefaultControll
er.php:5)"} []
I managed to fix this by entering full path to autoload.php:
require '/home/tdarlic/public_html/magniblu/users/vendor/autoload.php';
I tried with
../../../vendor/autoload.php
and with
../../vendor/autoload.php
require __DIR__.'../../vendor.autoload.php';
and still cannot figure out how to keep the autoload file link loading correctly on development machine and on the server.
Any ideas how to solve this?
Similar issue can be found on:
Why my autoload.php of composer doesn't work?

Autoload issue in PhpStorm and Laravel

I have created a Laravel project using PhpStorm but when I open index.php in the browser it shows some errors.
It opens http://localhost:63342/METU/public/index.php but it should be http://localhost:63342/index.php.
Warning: require(C:\Users\ilhan\PhpstormProjects\METU\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in C:\Users\ilhan\PhpstormProjects\METU\bootstrap\autoload.php on line 17
Fatal error: require(): Failed opening required 'C:\Users\ilhan\PhpstormProjects\METU\bootstrap/../vendor/autoload.php' (include_path='.;C:\php\pear') in C:\Users\ilhan\PhpstormProjects\METU\bootstrap\autoload.php on line 17
What is wrong with my project?
That error generally occurs when you haven't run composer install on a new laravel project. The autoload file it references will be created when you run that command.
As for the URL issue, you want to make sure your localhost is mapped to the /public folder of your laravel project, not mapped to the root of it.

Laravel: How to recover deleted folder from vendor directory

I used composer to get the laravelcollective/html dependency. But later on I did not need this and I accidentally deleted the folder myself without asking composer to do it for me. Now, whenever I try to run a local server or issue the update command with composer I get the following error:
[RuntimeException]
Error Output: PHP Warning: require(/media/adeel/643459A034597650/Projects/Laravel/vendor/laravelcollective/html/src/helpers.php): failed to open stream: No such file or directo
ry in /media/adeel/643459A034597650/Projects/Laravel/vendor/composer/autoload_real.php on line 55
PHP Fatal error: require(): Failed opening required '/media/adeel/643459A034597650/Projects/Laravel/vendor/laravelcollective/html/src/helpers.php' (include_path='.:/usr/share/p
hp:/usr/share/pear') in /media/adeel/643459A034597650/Projects/Laravel/vendor/composer/autoload_real.php on line 55
Even though the /laravelcollective directory does not exist anymore I still get this error. I have tried removing the whole vendor folder from my Laravel project and then issued a composer update command but I get this error:
[RuntimeException]
Error Output: PHP Warning: require(/media/adeel/643459A034597650/Projects/Laravel/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /media/
adeel/643459A034597650/Projects/Laravel/bootstrap/autoload.php on line 17
PHP Fatal error: require(): Failed opening required '/media/adeel/643459A034597650/Projects/Laravel/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share
/pear') in /media/adeel/643459A034597650/Projects/Laravel/bootstrap/autoload.php on line 17
It seems the problem was fixed by issuing the install command instead of update. I also removed the composer.lock file from its directory, but I don't think that made a difference.

Categories