I ssh to my VPS where there is a vagrant box that runs a symfony project.
When i try to access the project i am getting the error:
`Fatal error: Uncaught RuntimeException: Failed to write cache file` and
`Fatal error: Uncaught exception 'RuntimeException' with message 'Could not create cache directory`
I have tried fixing file permissions as mentioned here: http://symfony.com/doc/current/setup/file_permissions.html
and even changed chmod to 777. But still getting same error.
I also tried everything there: symfony2 : failed to write cache directory
It just won't work. Any help would be much appreciated.
My VPS is running ubuntu 16.04 and vagrant is latest version with image ubuntu/trusty
If you are running Apache check your /etc/httpd/conf/httpd.conf file and find your entry for your website in there. Check to see what user Apache is running the site as. You'll want to make sure the directories and files that make up your Symfony app belong to that user and the group the user is in as well. If you are logged in as root and are in the your Symfony directory you can run:
chown -R user:group *
to change all the files and directories to that user and group. Note to replace user and group in the command above with the actual username and group.
If you still have troubles after you've found the user apache is running as, try removing your symfony files completely (if it is a fresh project that you haven' been working on) and rebuild it while you are superuser'd (su) as that user. You probably built your project as root or another user.
Related
I'm trying to setup a Laravel project on Valet.
I'm getting this error:
Warning: require(/Users/davina/Developer/learn-laravel-graphql/public/../vendor/autoload.php): failed to open stream: No such file or directory in /Users/davina/Developer/learn-laravel-graphql/public/index.php on line 24
Fatal error: require(): Failed opening required '/Users/davina/Developer/learn-laravel-graphql/public/../vendor/autoload.php' (include_path='.:/usr/local/Cellar/php/7.3.1/share/php/pear') in /Users/davina/Developer/learn-laravel-graphql/public/index.php on line 24
Trying to link either the project root or /public folders results in the above error instead of Laravel's default welcome screen.
How do I resolve this?
Try to navigate to the project folder root and run the command:
composer -i
sudo chmod 755 -R folder_name
Create the .env file, if is fresh application just copy the content of the .env.example file.
inside the project folder again: php artisan key:generate
After those steps all up and running for me :)
Solves the issue for me.
Looks like you have a fresh installation of laravel here...or, you just cloned the repo?
If so, the first thing you should do is to try and install the packages that Laravel uses.
Within those packages is a file called "autoload.php" which your server is looking for here.
Now, to do that, simply navigate within your terminal to the directory of your project and run: composer install.
Wait for it to finish and then, try to continue from there.
Please help, I've tried everything;
The command works well on the development server, but not on live.
Before you mark it as duplicate:
The filename ends with Command.php
The Bundle is registered
The command is ContainerAware
The command is in the Bundle\Command directory and in the App\Bundle\Command namespace
I have tried:
clearing and warming up the cache on the server multiple times using the symfony console php console --env=preprod cache:clear and php console --env=preprod cache:warmup
listing available commands by calling the console without extra arguments php console --env=preprod
Is there any other way to force symfony to re-check available commands ?
For future reference:
The problem was that I connected to the remote host before deploy, and bash doesn't update symlink targets.
So the Command was not available in my current working directory.
A simple cd .., cd current solved it.
I am using Artifactory Professional, version 5.6.0 rev 50600900
When I try to deploy a file through the Artifactory web UI, I'm getting an error: '<filename> is undefined' in a red popup box.
When I look in the system log, I see:
2018-05-15 08:25:41,037 [http-nio-8081-exec-123] [ERROR] (o.a.r.c.e.GlobalExceptionMapper:48) - Permission denied
java.io.IOException: Permission denied
The time corresponds to the time I tried the deploy
Uploads using a curl command or via the Artifactory plugin in Jenkins work without any problems.
I am an administrator on Artifactory. other users with Delete/Overwrite, Deploy/Cache, Annotate and Read also are not able to upload to repos via the web UI.
I get the undefined error with all files i try to deploy, large or small. this error occurs for users on windows, mac os and linux.
thanks in advance for any help.
Looks like an file system permissions issue. Make sure that the OS user running Artifactory has write permissions to <ARTIFACTORY_HOME>/data/tmp.
The artifacts uploaded from the UI are temporally saved under this folder.
I deleted Cache and tmp directory of my serviceMix.
I'm trying to reinstall webconsole on using
features:install webconsole. I'm getting following error
Error executing command: Manifest not present in the first entry of the zip mvn:org.apache.felix/org.apache.felix.metatype/1.0.4
How can I solve this problem
There was a known problem with reorganization of maven repositories which caused some troubles. Please make sure that your local repository does not contain malformed JAR file (it happens sometimes with various gateways which redirects you to login page), then reconfigure repositories in etc/org.ops4j.pax.url.mvn.cfg and make entry
http://repo1.maven.org/maven2#id=central
First in list.
I am trying to install Symfony 2.1.3 (latest). I am running composer and installs everything okay. The only error that I get is:
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
handling the post-install-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command.
It's being installed under www folder. I am running nginx and followed the composer approach. I read on internet that apache should be run manually not as a service, however I am using nginx instead. Does apache still have any bearing on it? I'm using debian squeeze.
Edit: As per AdrienBrault's suggestion the error was because the timezone was not set in the php.ini. Only with --verbose I could see the warning. Thanks guys.
Apache is not related - PHP is called via command line.
Most likely is the permission in the cache folder: did you check if the user that runs the composer update can actually write the cache folder?
Try to manually run rm -Rf app/cache/dev (for production environment replace dev with prod) and see if you get any permission error.
Also you will get this error if the default.timezone setting is not configured in php when running in CLI. To verify just run
php --info | grep timezone
and check that the setting date.timezone is correctly configured.
On the security side, setting 777 to the folder is not the optimal solution - if you have ACL enabled you could use that to correctly set up the permission for the cache and logs folder. Read more at the Symfony2 official installation page
I had this same issue for a while and after hours of face to brick wall pounding I realized... I have a .gitmodule in my project, and on initial checkout these submodules are NOT initialized and as such are not there for your composer to update, which results in the above error.
Make sure you run the following
git submodule update --init src/Acme/Sadness/Bundle
of course replace src/Acme/Sadness/Bundle with YOUR project namespace.
Hope this helps someone not go through the same pain I just did.
If you have vendor folder already I would remove it and install symfony 2.1.3 again via "composer.phar install". Problem might be coming from outdated version of composer
I had the same problem and I resolve in this way.
execute this on the console
and you should see something like this
$ locate php.ini
/etc/php5/apache2/php.ini
/etc/php5/cli/php.ini
/etc/php5/fpm/php.ini
the first line is probably your php.ini that appear when you do a phpinfo();
the problem is that when you execute composer update this no check the same php.ini
in my case the second line
all my sites work fine but always I had problems not now
after edit the second file and put the same time zone that you set in the first one
run
$ sudo service apache2 reload
and now
$ composer update
I hope that this work for you like work for me
regards
Emiliano