Update: This was caused by SELinux.
--
Turns out it was some weird file system/user permissions error. After running ls -al /var/run
through the exec()
command in PHP, it returned this:
total 52
drwxrwxrwx. 23 root root 4096 Oct 12 15:13 .
drwxr-xr-x. 22 root root 4096 Oct 10 08:50 ..
d?????????? ? ? ? ? ? ConsoleKit
drwxr-xr-x. 2 root root 4096 Oct 11 18:13 abrt
-rw-r--r--. 1 root root 5 Oct 11 18:13 abrtd.pid
-?????????? ? ? ? ? ? acpid.pid
s?????????? ? ? ? ? ? acpid.socket
-?????????? ? ? ? ? ? atd.pid
-?????????? ? ? ? ? ? auditd.pid
-?????????? ? ? ? ? ? autofs-running
p?????????? ? ? ? ? ? autofs.fifo-misc
p?????????? ? ? ? ? ? autofs.fifo-net
-?????????? ? ? ? ? ? autofs.pid
drwxr-xr-x. 2 root root 4096 Feb 22 2013 certmonger
-?????????? ? ? ? ? ? certmonger.pid
d?????????? ? ? ? ? ? console
-?????????? ? ? ? ? ? cron.reboot
-?????????? ? ? ? ? ? crond.pid
d?????????? ? ? ? ? ? cups
-?????????? ? ? ? ? ? cupsd.pid
drwxr-xr-x. 2 root root 4096 Oct 11 18:13 dbus
drwxr-xr-x. 2 root root 4096 Feb 21 2013 faillock
d?????????? ? ? ? ? ? hald
-?????????? ? ? ? ? ? haldaemon.pid
drwx--x---. 2 root apache 4096 Oct 12 15:26 httpd
d?????????? ? ? ? ? ? lvm
s?????????? ? ? ? ? ? mcelog-client
-?????????? ? ? ? ? ? mcelog.pid
d?????????? ? ? ? ? ? mdadm
-?????????? ? ? ? ? ? messagebus.pid
drwxr-xr-x. 2 mysql mysql 4096 Oct 11 18:13 mysqld
drwxrwxr-x. 2 root root 4096 Feb 22 2013 netreport
d?????????? ? ? ? ? ? plymouth
d?????????? ? ? ? ? ? pm-utils
d?????????? ? ? ? ? ? portreserve
-?????????? ? ? ? ? ? rpc.statd.pid
-?????????? ? ? ? ? ? rpcbind.lock
-?????????? ? ? ? ? ? rpcbind.pid
s?????????? ? ? ? ? ? rpcbind.sock
d?????????? ? ? ? ? ? saslauthd
d?????????? ? ? ? ? ? screen
d?????????? ? ? ? ? ? sepermit
drwxr-xr-x. 2 root root 4096 May 10 05:06 setrans
-?????????? ? ? ? ? ? sm-notify.pid
-?????????? ? ? ? ? ? sshd.pid
-?????????? ? ? ? ? ? syslogd.pid
-?????????? ? ? ? ? ? utmp
drwxr-xr-x. 2 root root 4096 Feb 21 2013 winbindd
I fixed it by deleting the directory and making the /var/run
permissions 0777. This meant that the web server user could create the directory and use it as expected.
rm /var/run/screen -R -f
chmod 0777 /var/run
I still don't know why this has happened, nor why there are question marks all over the place in the ls
command. If anyone sees this and knows, please leave a comment or answer explaining why. It will be a big help, since I know have more errors.