Joomla Writable files and folders with permission 755 on linux server

Posted on 2008-11-06
Last Modified: 2013-12-15
We have severals servers and VPS running Cpanel ,
We noticed that on some servers we have problems with Joomla script to make it work like it should do.
The problem on those servers: Joomla can not write some config files with permission 755 like every fresh instalation came, for example configuration.php can not be written by joomla if it is on 755 , so I have to set it to 777 with is dangerous.

But the fact is that the same install work perfectly on another servers.
Obviusly is something about Apache or PHP configuration.

Could someone help me to configure my apache or php in order that Joomla can write those files and folders with permissions 755 ?
Question by:ultra1
    LVL 14

    Expert Comment

    The problem is the owner - the "apache" user needs to own those files.  The files that you want to write should actually probably be something like 640, or 600, etc.  PHP files don't need to be executable to be parsed by the web server.
    LVL 14

    Expert Comment

    On other servers, perhaps running a different linux distro, apache runs as an "httpd" user, or "nobody".  So maybe your script is making one of those users the owner, instead of "apache"?

    For more troubleshooting post your script, and the steps you are taking to install joomla.

    Author Comment

    On all my servers I have Centos 4 OS, On all my servers Apache run as "nobody" and on all my joomla installs I have configuration.php  with the current user as owner and with permissions 755 , but.. on some servers joomla can write configuration.php and on another I get a warning that tells that configuration.php is unbritable.

    I heard something about Mod SUPHP , but I am not sure if this is the solution
    LVL 7

    Accepted Solution

    suPHP is probably why it's working on some servers.

    suPHP causes PHP scripts to run as the user, rather than the 'nobody' user (or whatever user the webserver runs as).

    There's security implications to this.  The main issue is it means that if someone can compromise one of the scripts thru the webserver, they can modify all the content, i.e. deface your site.

    Setting the file to 777 does mean that someone else on the server could modify the file, but it's usually the lesser evil, unless you _trust_ your web scripts.  (Unless you wrote them, and you specialize in writing secure web scripts, I wouldn't trust them.  Especially not something huge and complex like Joomla, where bugs are likely to lurk in the shadows.)

    You can also use group ownership, or ACL's, to allow only the 'nobody' user to modify the file... however, that does mean that anyone else coming in thru the webserver could edit the file; i.e. if another user wants to edit the file, they just create a PHP script in their homedir to do it, and access that script thru the webserver.

    If security is a chief concern, put the site on a dedicated webserver, and/or make the configuration.php writable only when you need to edit it, and keep it 755 the rest of the time.

    I would really really suggest avoiding suPHP unless you really really understand all the security implications.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
    Join Greg Farro and Ethan Banks from Packet Pushers ( and Greg Ross from Paessler ( for a discussion about smart network …
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now