Testing which uid php is running as to debug read/write issues


Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"


Top Level » Apache Related Information » Php

Testing which uid php is running as to debug read/write issuesLast Modified: Feb 3, 2014, 5:41 pm
Often times, a php script needs write access to disk.
Most new installs will use mod_ruid2+cli, suPHp, fastcgi or php-fpm, which should all run php as the given User, rather than as "apache".

To determine what uid a php process is running as, you can use this script to get a definitive answer:

<?php
system('/usr/bin/id');
phpinfo();
?>

Save this to an info.php file in a path you're trying to debug, then view it through Apache.

Note that this requires that both "system" and "phpinfo" not be set in your disabe_functions list in your php.ini.
 
Related Helpfiles
Files uploaded with php scripts are owned by apache - how to install suPhp
Where is my php.ini?

© 2018 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST