I’m making a simple web server using PHP and sockets. Everything is working fine right now (static content only). I’m interested in supporting the execution of PHP files.
How would I go about doing this? I don’t really want to use eval($fileContents) since that does not seem very secure. Is there some way that I can use FastCGI sockets or something?
What about PHP-CGI?
I’ve decided on using FastCGI, so
here’s a more specific question:
How do I pass files into PHP-CGI and get the output as a string?
php-cgi "phpinfo.php" outputs HTML content like I want.
I understand that I can use sockets but I can’t seem to find out what to send into that socket to get the output.
Thanks
what’s so insecure in eval($fileContents)? or, more familiar but actually equal include $fileName?
(with proper filename sanitizing of course)
apparently it’s no more insane than PHP web server itself.