Hello,
I moved my Magento server and now my image cache will not works. After investigation, I found a potential reason.
Magento can't write on my server.
But I have no idea to solve it. All of my directories and files have 777 in permissions. The owner of my directories is the user "apache" (I read this user is the webserver user of centos).
Technical infos :
My server is running on CentOs 7 with PHP 5.6 and apache 2.4.6.
Other observations :
So my problem seems be in permissions but I have no idea how to solve it. I'm new in Linux and server configuration.
Solved! Go to Solution.
I get a solution on stack overflow, in my case, SELinux prevent my apache user to write into files server. So I disable his enforcing by this command
sudo setenforce 0
and now, my website works like a charm.
Thx for your time and I'm sorry to ask into the wrong forum because Magento was not the cause.
Hi @JulienVDB,
Using 777 permissions isn't recomended.
Maybe (just maybe) you have some issue with the user running the webserver.
You can read more about recomendations and how to fix permissions issues here (you'll find also the commands to fix the situation):
http://devdocs.magento.com/guides/m1x/install/installer-privileges_after.html#privs-after
Also, take a look on which user has the ownership of, for example, index.php and which user is the owner of var/cache/ files to be sure that the user is the same.
Thx for your answer,
About 777 permissions, I know it's not recommended but I use it just for development and test my new server, after this, I will fix it with 755. By the way, I didn't say it but my new server is only host in my local machine. The goal of my enterprise is to show the website without internet connection in a trade fair. So, the miss security with 777 permissions will not have a real problem.
About owner, root are the owner of my index.php and all other directories on my server. And in Magento files, it was 503 and 500 to owner user and owner group. But I change it to root:root and it still has not permissions.
Which user is using by Magento to write into the webserver ? When I search about that, this seems to be the web server user (in my case, CentOS 7, "apache" ?). But I didn't find really sure information about that.
EDIT : I also check the var/cache. This directory will stay empty when i reindex all but magento admin but when I reindex all via "php indexer.php reindexall", the directories mage--x appears. The directories are writable by my root user but the Magento user can't. I think, the Magento user will not exist on my new webserver but I have no idea how to change him or how to show who is he ?
EDIT 2 : When I run the php function "get_current_user()", it returns me an user "davidts". It's the ftp user name of my old server but I still not know where I can change it.
EDIT 3 : I still stuck but I know the problem comes from my server configuration and not my magento configuration, so I close this post. If someone has an idea to help me, he can answer it to
http://stackoverflow.com/questions/41381097/miss-understanding-about-apache-and-permissions
Thx for reading
Try running the command (on shell):
ps aux | egrep '(apache|httpd)'
First column will tell you which user is running Apache.
I get a solution on stack overflow, in my case, SELinux prevent my apache user to write into files server. So I disable his enforcing by this command
sudo setenforce 0
and now, my website works like a charm.
Thx for your time and I'm sorry to ask into the wrong forum because Magento was not the cause.