LAMP Error on AWS: Error writing server configuration file ".htaccess" - silverstripe

I'm setting up a silverstripe(4) project using LAMP with AWS and I am new to the programming world.
I'm having trouble with after entering the php dev/build.
This error comes up:
error-log.ERROR: Uncaught Exception Exception: "Error writing server configuration file ".htaccess"" at /var/www/alsoherdaughter/vendor/silverstripe/assets/src/Flysystem/AssetAdapter.php line 157 {"exception":"[object] (Exception(code: 0): Error writing server configuration file \".htaccess\" at /var/www/alsoherdaughter/vendor/silverstripe/assets/src/Flysystem/AssetAdapter.php:157)"}
Not sure what I have done wrong. I have looked about for information/resolutions but not having much luck.

You should be able to (temporarily at least) solve any permission issue with:
chmod 777 /var/www/alsoherdaughter/ -R
(in a Linux terminal)
I mentioned temporarily. If you don't have ownership to the items at hand, it's possible the above chmod will be overwritten again by some other process operating by someone else.
You might be able to permanently solve it with:
chown /var/www/alsoherdaughter/ YOUR_USERNAME_HERE

Related

Problems running an image of worpress in docker on Raspberry PI

I'm trying to run an image of wordpress in a docker, on my raspberry PI 3. I install the docker, add my 'pi' user to the docker group and I can run images like "hello-world" but when I try to run an image of wordpress I got error of premissions like this:
tar: ./wp-blog-header.php: Cannot utime: Operation not permitted
tar: ./wp-signup.php: Cannot utime: Operation not permitted
tar: ./index.php: Cannot utime: Operation not permitted
tar: ./wp-config-docker.php: Cannot utime: Operation not permitted
tar: .: Cannot utime: Operation not permitted
tar: Exiting with failure status due to previous errors
Someone can help me with this error, I can't understand what kind of permissions are missing... ?
I'm using the latest image of wordpress, I just type: "docker run wordpress" I don't know if we need to check something in the image...
Thanks
This sounds to me like the semi-recent seccomp issues that have plagued containers thanks to libc updates using new syscalls; see https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.13.0#time64_requirements and/or https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.14.0#faccessat2 for details.
I would suggest updating Docker, runc, and libseccomp on your host, which will likely resolve this.
If you want a quick test to verify that this is indeed the problem and updating will likely fix it, you can try running the container again with --security-opt seccomp=unconfined -- if that succeeds, you definitely want to update your host.

How to fix 'Uncaught PHP Exception Twig_Error_Loader: Unable to find template' on Symfony 3.4?

I deployed a symfony 3.4 project from my local machine (Windows 10) to a cloud server (Digital Ocean) based on Ubuntu.
I spent 2 days trying to resolve this (i think) routing problem:
"request.CRITICAL: Uncaught PHP Exception Twig_Error_Loader..."
Locally, on localhost with XAMPP, it works perfect.
The project runs ok on the login (is like a backend user app), with the register ok But when it tries to pass the login, it needs to load the initial dashboard with some includes (like nav_side.html.twig) and the server response is error 500.
How can i fix it?
Thanks a lot for your response...i'm a little bit desperate. :)
I made composer update, i deleted the cache folder, but the error is still there.
request.CRITICAL: Uncaught PHP Exception Twig_Error_Loader: "Unable to
find template "Backe ndBundle:includes:nav_side.html.twig"
(looked into: /var/www/onecup/app/Resources/views,
/var/www/onecup/vendor/s
ymfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in
"BackendBundle:Dashboard:index.html.twig" at line 7." at
/var/www/onecup/vendor/twig/twig/lib/Twig/Loader/Filesystem.php line
234 {"exception":"[object] (Twig_Err or_Loader(code: 0):
Unable to find template \"BackendBundle:includes:nav_side.html.twig\"
(looked into: /var/www/ onecup/app/Resources/views,
/var/www/onecup/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form)
in \"BackendBundle:Dashboard:index.html.twig\" at line 7. at
/var/www/onecup/vendor/twig/twig/lib/Twig/Loader/Fil
esystem.php:234)"} []
#Flying was right: examine your code and try to find possible case inconsistences in directory / filenames. e.g. "file" and "File". Windows filesystem is case-insensitive, but Ubuntu filesystem is case-sensitive.
So, i changed the Includes to includes and that's all.
Thanks a lot!! :)

making first commit into diffusion git :Phabricator

I am setting up a phabricator server and i am observing the below issue, both from my diffusion repository Status window and the daemons.log file
Error updating working copy: Command failed with error #128!
COMMAND
git log --format='%H%x01%P%x01%ct' --all --
STDOUT
(empty)
STDRR
fatal: bad default revision 'HEAD'
After reading on this issue, i figured out that this is a common issue with bare repositories without first commits. So i tried committing from my local system through repository http URI, but it is returning a 500 exception.
below is the error message i pulled out from phabricator database:
$ select * from phabricator_repository.repository_pullevent;
500 | {"response.message":"Error 1: sudo: a password is required\n"}
Can any one help me out to understand the issues from repository_pullevents and daemons.log file.
thanks in advance!
i resolved the problem with sudo, by changing the user running apache and adding the symlink created for git-http-backened in sudoers for the apache user.
and the problem with repository bad HEAD revision was resolved by making the first commit from a client machine.

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

Symfony production environment throws 500 error: Doctrine\ORM\ORMException 'Unknown Entity namespace alias 'DSBlogBundle'

I'm learning Symfony2, really cool stuff. But I do run into some trouble when I want to try and visit the production environment. I have followed the Symblog Tutorial that is located here: http://tutorial.symblog.co.uk/
I have cleared the cache and I visit http://symfony.dev/ I have running locally. The page remains totally blank and this error is in the log:
Fatal error: Uncaught exception 'Doctrine\ORM\ORMException' with message 'Unknown Entity namespace alias 'DSBlogBundle'.'
in /Applications/MAMP/htdocs/symfony/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php:236
Stack trace:
#0 /Applications/MAMP/htdocs/symfony/vendor/doctrine/orm/lib/Doctrine/ORM/Configuration.php(194): Doctrine\ORM\ORMException::unknownEntityNamespace('DSBlogBundle')
#1 /Applications/MAMP/htdocs/symfony/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php(554): Doctrine\ORM\Configuration->getEntityNamespace('DSBlogBundle')
#2 /Applications/MAMP/htdocs/symfony/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php(194): Doctrine\ORM\Mapping\ClassMetadataFactory->getFqcnFromAlias('DSBlogBundle', 'Blog')
#3 /Applications/MAMP/htdocs/symfony/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(295): Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->getMetadataFor('DSBlogBundle:Bl...')
#4 /Applications/MAMP/htdocs/symfony/vendor in /Applications/MAMP/htdocs/symfony/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php on line 236
What I don't get is that the 'Unknown Entity namespace alias 'DSBlogBundle' is perfectly "known" in the development environment. Does anyone know what I am missing? Any help is much appreciated! Thank you!
Couple possibilities I can think of:
1) If your code functions properly in the development environment, then it could be a cache problem and/or a permissions problem. Make sure your files are readable by the user/process associated with your web server and make sure the prod cache directory is writable by that user so it can generate the necessary files. What I generally do is run the clear cache console command AS that user to avoid unexpected cache problems, like this (on linux):
sudo -u www-user php app/console cache:clear --env=prod
If you're developing on linux, you must be logged in as either root or another user with administrator privileges to run a command as a user other than yourself.
2) You may have configurations defined in the dev environment that don't exist in the prod environment. Double check the files in your app/config folder. My first guess would have been that the DSBlogBundle wasn't correctly defined in app/AppKernel.php but I believe that's environment independent so it couldn't work in dev but not prod.

Resources