After changing all the WordPress permissions to 777 and assigning them to group of apache:apache still Wp Super Cache plugin can't change the wp-config.php
I don't know why!
My server is :
CentOS 7
PHP 71
Apache
MariaDB
Apache Error Log:
[Thu Nov 02 02:01:45.637165 2017] [php7:warn] [pid 17633] [client 5.202.27.148:25292] PHP Warning: include(): Failed opening '/var/www/html/wp-content/plugins/wp-super-cachewp-cache-base.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/wp-content/plugins/wp-super-cache/wp-cache.php on line 72, referer: http://website.com/wp-admin/post.php?post=10821&action=edit
Wordpress Error:
Warning! You must set WP_CACHE and WPCACHEHOME in your wp-config.php for this plugin to work correctly: define( 'WP_CACHE', true );
define( 'WPCACHEHOME', '/var/www/html/wp-content/plugins/wp-super-cache' );
This is right. wp-config should be writeble only by user manually. This file should not be writable using code. Please put these configuration manually in your wp-config.php.
My problem solved by disabling SELinux that prevents apache user from editing files and folder.
Related
I have a server set with NGINX: https://www.nginx.com/resources/wiki/start/topics/recipes/wordpress/
Recipe
Abridged basic setup
I have deployed WP in this directory: /var/www/blog.example.com/
/var/www and /var/www/blog.example.com/ does have nginx:nginx file/dir perms.
wp-config.php - 644
wp-content - 755
wp-content/plugins - 755
NGINX is running as nginx user.
I can browse in entire WordPress site including admin. However, when I want to install a new plugin or update I got always the message:
Installing plugin: iThemes Security (before Better WP Security) 7.9.1
Downloading the installation package from
https://downloads.wordpress.org/plugin/better-wp-security.7.9.1.zip…
Decompressing…
An error occurred while installing iThemes Security: Directory could not be created
What's I am wrong?
All libraries required according to https://make.wordpress.org/hosting/handbook/handbook/server-environment/ was installed.
When I try to upgrade a theme, for example, I got 200 code "OK" from a web server, but, I don't see anything in the error_log of NGINX.
Also, I've checked the php-fpm but I don't see any updating error.
php-fpm was running as an apache user.
I've switched the user into Nginx and It's solved. :D
It looks that the issue is the 'plugins' folder writing permissions. WP downloads the zip archive of the plugin then it decompresses it to the 'plugins' folder.
This article will help:
https://secure.wphackedhelp.com/blog/fix-file-and-folder-permissions-error-wordpress/
Just adding onto #sincorchetes answer, to those who need more specific instruction:
vim /etc/php-fpm.d/www.conf
I changed the lines
user = apache
group = apache
to
user = nginx
group = nginx
Then restarted the php-fpm and nginx service
systemctl restart php-fpm
systemctl restart nginx
creating symfony project
composer create-project symfony/skeleton cars
cd cars
php -S 127.0.0.1:8000 public/index.php
composer require annotations
composer require twig
composer require asset
Creating Page
public/image/seta.png
templates/number.html.twig
<img src="{{asset('image/seta.png')}}">
src/Controller/CarController.php
/**
* #Route("/")
*/
public function number()
{
return $this->render('number.html.twig');
}
Why does browser show:
Symfony Exception > ResourceNotFoundException > NotFoundHttpException
No route found for "GET /image/seta.png" (from "http://localhost:8000/")
(Web page doesn't show seta.png)
The issue you're having is that the browser can't find the image, as in the path you have given it doesn't exist or isn't accessible to the client. That's what your error is indicating.
You need to confirm that you can access the image through your browser first. If you can't, then I would suggest you start to look at it's location and whether the path you're using corresponds to it's location.
If you're sure the file path is fine and the image exists and that it's named correctly corresponding to what you're calling it, you should then check the file and folder permissions where the image is located so it's accessible.
Please check the HTML, this code rendered.
<img src="{{asset('image/seta.png')}}">
change
php -S 127.0.0.1:8000 public/index.php
to
php -S 127.0.0.1:8000 -t public
Ronald2g is right, you can also try with the web server bundle:
composer require server --dev
and:
php bin/console server:start
Not sure if it can help you, but this might help others having a similar issue.
I had the same issue when I was mistakenly using an internal port number (port 42595 in the example below) given in the command line feedback, instead of port 8000:
$ symfony server:start --no-tls
Feb 25 12:25:30 |DEBUG| PHP Reloading PHP versions
Feb 25 12:25:31 |DEBUG| PHP Using PHP version 7.4.2 (from default version in $PATH)
Feb 25 12:25:31 |INFO | PHP listening path="/usr/bin/php7.4" php="7.4.2" port=42595
Feb 25 12:25:31 |DEBUG| PHP started
Feb 25 12:25:31 |DEBUG| PHP PHP 7.4.2 Development Server (http://127.0.0.1:42595) started
[OK] Web server listening on 8000 http://127.0.0.1:8000 (PHP CLI 7.4.2)
I use SSH keys in my wp-config since a long time. Updates, plugin installation and removal, all worked well. After the last apt-get update wp is asking for the FTP password when I try to install for example a plugin.
There was no change done to the wp installation nor the file or directory permissions. I did not update wp either.
define('FTP_PUBKEY','/home/wp-user/wp_rsa.pub');
define('FTP_PRIKEY','/home/wp-user/wp_rsa');
define('FTP_USER','wp-user'); define('FTP_PASS','');
define('FTP_HOST','127.0.0.1:22');
Ubuntu 14.04
WORDPRESS VERSION: 4.7.6
PHP VERSION: 5.5.9-1ubuntu4.22
WEB SERVER INFO: Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f
EDIT:
I added below to my wp-config to see if it changes something.
define('FS_METHOD', 'ssh2');
No I'm getting a different error message in the WP backend:
The ssh2 PHP extension is not available
...but ssh2 is installed and loaded:
# php -m |grep ssh2
ssh2
Seems to be a bug in libssh2-php...
https://bugs.launchpad.net/ubuntu/+source/php-ssh2/+bug/1617294
Installing the WP plugin below allows me again to install/update as before.
https://en-ca.wordpress.org/plugins/ssh-sftp-updater-support/#description
After installing the Elastix 4.0 distro, I always have a broken web-admin panel. What am I doing wrong?
/var/log/httpd/ssl_error_log
[Fri Oct 07 22:34:08.636204 2016] [:error] [pid 4510] [client 192.168.88.88:50414] PHP Fatal error: Uncaught --> Smarty: unable to write file /var/www/html/var/templates_c/wrt57f7eaa09b4319_91812285 <-- \n thrown in /usr/share/php/Smarty/sysplugins/smarty_internal_write_file.php on line 46
You'll need to make the /var/www/html/var/templates_c directory writable by the user the web server is running under. For example:
chmod -R +w /var/www/html/var/templates_c
Apache should work under asterisk user.
/var/www/html/ and /var/lib/php should be changed to same owner.
I have installed Ubuntu 14.04 and Apache2.4.7 But when I tried to create the vhost it start giving me the error. after that I have put my project in the /var/www/html directory its still not accessible.
[Thu Apr 16 09:56:38.559161 2015] [core:error] [pid 3412] (13)Permission denied: [client 127.0.0.1:59566] AH00035: access to /cls/web/app_dev.php denied (filesystem path '/var/www/html/cls/web') because search permissions are missing on a component of the path
I have fixed the issue i just have changed the permissions of the directory to 755 and it worked for me.
sudo chmod 755 /to/directory