Hello,I'm having issues with the initial installation of osticket. I set ost-config.php file to 0666 and gave ownership of the file to apache. I still keep getting the error that the file is not writable. I also tried to disable selinux but that did not resolve the situation. I am using CentOS 6.5. Please help!Thanks,Aaron 

This really sounds like a server configuration issue.You should find out what user your apache runs as and chown it to that user.You can try setting the file to 777 temporarily.You would also probably want to make sure that SELinux is disabled, and restart Apache.

SELinux can be tricky.  If you use the command shell, run:ls -laZ ost-config.phpor cd to that directory and run:ls -laZ ost-config.phpThen report the output here.Oh, one more thing. Run "sestatus" and give us the output of that one, too.Jack

ls -laZ command output on the ost-config.php file:-rw-rw-rw-. apache apache unconfined_u ost-config.php

sestatus output:SELinux status: enabledSELinuxfs mount: /selinuxCurrent moude: enforcingMode from config file: disabledPolicy version:  24Policy from config file:  targeted

According to sestatus, SELinux is enabled. It looks like you disabled it in the config file, so it ought to be disabled after the next rebootBut you may not have to disable it, it looks to me from the ls -laZ ouitput that  file's context is not right.  Try this (as root):restorecon ost-config.phpThat should set the file's context appropriately, based on defaults for the file type (php).Jack

That did it!! Restoring the file's context worked. Thanks so much for the help JackRogers

Glad to help, especially when someone is willing to use the command line!Jack

7 years later

Same problem for me as well. Please help:
sestatus:

SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      31

ls -laZ ost-config.php:
-rw-rw-rw-. osticket osticket unconfined_u:object_r:httpd_sys_content_t:s0 ost-config.php

@tominp

  1. You're posting on an old/dead zombie thread. Please refrain from doing so in the future and create your own Discussion.
  2. This is more of a server-end issue rather than an osTicket issue. You should really read the SELinux documentation so you're not running blind.

With this being said, I'll post the resolution here anyways. You have the httpd_sys_content_t context set for the file but this does not allow read/write. You will need to run the following command to set the httpd_sys_rw_content_t context:

sudo chcon -t httpd_sys_rw_content_t /path/to/osticket/include/ost-config.php

Killing zombie thread with a headshot. 🧟‍♂️💥

Cheers.

Write a Reply...