hey guys
im a linux newbie
,i want to know how to make the apache webserver write to templates_c

i tried
chown -R apache:apache templates_c

but it still says

Your templates_c directory is not writable by the web server

pls help

asher

Dani AI

Generated

Quick checklist and targeted steps for the "templates_c not writable" issue. The error means the Apache process cannot create files in that directory. was right that you need root privileges to change ownership; was right about permissions but his example used a different directory name (note the typo: template_c vs your templates_c). 's MC suggestion is handy if you prefer a UI.

First, confirm what the webserver user is and inspect the directory and every parent directory on the path:

ps -ef | egrep 'httpd|apache2' | egrep -v 'egrep|grep'
ls -ld /full/path/to/templates_c
namei -l /full/path/to/templates_c

On systems with SELinux enabled, check its mode and the directory context:

getenforce
ls -Z /full/path/to/templates_c

What to do depending on results:

  • If the Apache process runs as a different user than the owner/group shown, either make the directory owned by that user, add the server user to the directory group, or give the server user write rights with ACLs rather than making the directory world-writable.
  • To grant just the Apache user write access (without changing ownership), use filesystem ACLs and set defaults so new files inherit the permission.
  • If SELinux is enforcing and context is wrong, set the httpd write context (or use semanage+restorecon for a persistent change).

Avoid setting 777 on web folders. Also check the server error log for "permission denied" messages and ensure none of the parent directories block traversal. For details on which user Apache runs as and related config see the official Apache docs: https://httpd.apache.org/docs/

Recommended Answers

All 8 Replies

Try:

sudo chown -R apache:apache templates_c

If you have the root password.

My guess is that your permissions are screwed up. Try something like:

chmod 775 template_c

This will ensure that both the user 'apache' and the group 'apache' will have read/write/execute permissions in the directory, while everyone else will have read/execute permissions.

You're horrible John A. You always own me in this board.

Rawwwwr!

>You always own me in this board.
Try Usenet. Even if you're correct you still get owned. :P

Hahaha. But still. You know too much compared to me!

if you want a more graphical way of chowning/chmoding stuff, you can use MC (midnight commander). It looks like the old dos shell did.

if you want a more graphical way of chowning/chmoding stuff, you can use MC (midnight commander). It looks like the old dos shell did.

khe khe, young'un :)
it looks like old Norton Commander :)))

i never used norton commander, only dos/dos shell/windows 3

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.