Last active
December 30, 2015 03:49
-
-
Save enderandpeter/7772048 to your computer and use it in GitHub Desktop.
Show the php process owner and the permissions for the current directory. Then try to write a file with file_put_contents.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$processUser = posix_getpwuid(posix_geteuid()); | |
print 'Process owner: ' . '<b style="color:blue">' . $processUser['name'] . '</b>'; | |
echo "<br /> This directory's permisions: <i>" . exec('ls -ld') . '</i><br />'; | |
echo file_put_contents('test.txt', 'hey there') . ' bytes written.'; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment