Prod logs in symfony 2 not using root dir - symfony

I'm developping a symfony2 website. I'm using apache2.2.
Everything works fine in dev environment.
But when i want to try it on the prod environment, it goes :
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or
file "/var/www/domain/app/logs/prod.log" could not be opened:
fopen(/var/www/domain/app/logs/prod.log) [function.fopen]: failed to open stream: No
such file or directory' in /var/www/myapp/app/cache/prod/classes.php on line 4799
Why is it trying to write in /var/www/domain since my application is in /var/www/myapp ?
I tried to modify the config_prod.yml to no result.
Any idea ?
Thanks

#Boris Guéry it was a cache problem, you were right, but i couldn't use de command line to clear it. I had to use rm -rf in the shell.
Thanks

Related

Android Studio 4 Build ERROR : Execution failed for task ':app:mergeDebugResources'

Hello this is my first time make android program and found this error but the code not have an error point. the error message is below :
Execution failed for task ':app:mergeDebugResources'.
Could not resolve all files for configuration ':app:_internal_aapt2_binary'.
Failed to transform aapt2-4.1.1-6503028-windows.jar (com.android.tools.build:aapt2:4.1.1-6503028) to match attributes {artifactType=_internal-android-aapt2-binary, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for Aapt2Extractor: C:\Users\lenovo.gradle\caches\modules-2\files-2.1\com.android.tools.build\aapt2\4.1.1-6503028\cc838ebadee3649d47e07d029371bc1054e2200d\aapt2-4.1.1-6503028-windows.jar.
> java.io.IOException: Unable to delete directory 'C:\Users\lenovo.gradle\caches\transforms-2\files-2.1\aa8b5888abc00f78a9403248465821cc'
Failed to delete some children. This might happen because a process has files open or has its working directory set in the target directory.
- C:\Users\lenovo.gradle\caches\transforms-2\files-2.1\aa8b5888abc00f78a9403248465821cc\aapt2-4.1.1-6503028-windows
can someone tell me how to fix it ?
i had same problem in linux
tried many ways and asked some question.
finally found out there is file missing named aap2 in build-tools
i couldn't find that file to place it in destination so i deleted whole file and re Download it with sdk manager and if it doesn't work too i guess u should try reinstall android studio
yes its not a good answer but it was all experience i had with this error.

How to fix "vagrant up" errors when trying to set up Trellis?

I've been trying to set up a Trellis local WordPress dev environment from the Roots stack. I did all the steps from the docs, have the recommended folder structure, downloaded all the dependencies, but I still get a few errors.
First I get some errors and warnings when I use "yarn" in my theme folder, as suggested here. They say to use the CLI from my host instead of Vagrant box, that's just the MacBook's terminal right? Or do I need a CLI from VirtualBox?
The second error happens when trying to call "vagrant up", and this is one that I can paste here as it's a bit more concise.
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["hostonlyif", "create"]
Stderr: 0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to create the host-only adapter
VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage: error: Context: "RTEXITCODE handleCreate(HandlerArg *)" at line 95 of file VBoxManageHostonly.cpp
After Googling this I got a lot of outdated suggestions to check my PATH and restart the VirtualBox, but these I tried and didn't help. I hope someone can help me set this up, thanks. :)

Symfony 4 - php bin/console server:run not works

I have a problem with this command : php bin/console server:run on Symfony 4
When I go to http://127.0.0.1:8000/ I have this error message :
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'J:\my_project\vendor\symfony\web-server-bundle/Resources/router.php' (include_path='.;C:\php\pear') in Unknown on line 0
Indeed, the router.php file does not exist !
But if I run this command : php -S 127.0.0.1:8000 -t public everything is ok.
Any idea ?
First check that you have installed the SF4 Web Server bundle :
> composer require server --dev
then you can start using it through Symfony using run / start command
Not sure if this is the case for you too, but it is probably worth checking (and may also be interesting for others having the same problem).
My antivirus software likes to put the router.php in quarantine (effectively removing it from that directory). Check if yours did the same and if so restore it and create an exception for that file. Additionally you should configure your antivirus to notify you if it puts something in quarantine, so you can intervene in time.

error when I try to open app_dev.php file

I install symfony 2 under htdocs(xampp) folder, I start apache then I try to open app_dev.php file using this url :
http://localhost/symfony2/web/app_dev.php
I get this error :
Warning: require(C:\xampp\htdocs\symfony2\app/../vendor/autoload.php):
failed to open stream: No such file or directory in
C:\xampp\htdocs\symfony2\app\autoload.php on line 9
Fatal error: require(): Failed opening required
'C:\xampp\htdocs\symfony2\app/../vendor/autoload.php'
(include_path='C:\xampp\php\PEAR') in
C:\xampp\htdocs\symfony2\app\autoload.php on line 9
the tutorial that I follow (here) say that it will open a page
I reistall symfony using this command :
$ composer create-project symfony/framework-standard-edition my_project_name "2.7.*"
it works perfectly
Best way is to start symfony via the console to get the development enviroment:
bin/console server:run
http://symfony.com/doc/current/book/installation.html#running-the-symfony-application
Also check the read and write privileges, and check the composer installation.

Permission denied with wkhtmltopdf

I have installed Wkhtmltopdf and I have this error when I execute him "/var/chroot/wkhtmltox-jessie-amd64: Permission denied". I search in Google but I have not found how to do ... repertory have this permission "drwxr-xr-x root root" and i execute him in web-server (apache) and Symfony.
Error :
The exit status code '126' says something went wrong:
stderr: "sh: 1: /var/chroot/wkhtmltox-jessie-amd64: Permission denied
"
stdout: ""
Can you help me ?
I encountered the same problem on the server; it was weird that the local version was happily doing its job.
After changing the generated file's destination folder permissions without any luck, I realised that the problem whas caused by the binary path in config.yml. I changed it from:
/opt/wkhtmltox/bin/wkhtmltopdf.exe
to:
/opt/wkhtmltox/bin/wkhtmltopdf
Now all it's ok.
PS: if you don't keep wkhtmltopdf in the vendor's file (my case), create a knp_snappy config in config_prod.yml; the paths are different from local to prod version.
Here is the official documenation of KnpLabs Bundle for more info.
Good luck ! (in case you needed any 'after 1 year and 11 months' answear)
Install library Wkhtmltopdf on custom folder in the user directory for linux or mac save this route and set in your config
This solution working in production server
This error is because var and opt folder you can't write any content if not root user
if you use net core or .net, use:
sudo chmod 777 -R <Directorio que contiene el wkhtmltopdf>
the error is caused because the program does not have writing permissions

Resources