0

I tried to use mongoose embedded webserver with php-cgi, but the files is keeping to show the source code:

<?php echo "1"; ?>

I am using this command with mongoose:

./mongoose -C php -I /usr/bin/php-cgi

Can you help me?

JohnnyHK
  • 305,182
  • 66
  • 621
  • 471
Anwar Mohamed
  • 625
  • 2
  • 13
  • 27

2 Answers2

1

you should modify the file '/etc/php5/cgi/php.ini' or '/etc/php.ini/',set the 'doc_root' same to the 'document_root'.It will be ok!

vonnyfly
  • 7
  • 2
0

It seems mongoose is working fine, but php is not.

Are you sure php-cgi is available on your system? Or maybe php-cgi is installed but the path you are using (/usr/bin/php-cgi) is not right.

Try running on your terminal which php-cgi and check the response. If you get no response it means that you have to install it. To install php-cgi on MacOS read this: http://wayneeaker.com/blog/2012/04/05/setting-php-cgi-mac-os-x, it worked for me. On ubuntu it's easier: sudo apt-get install php5-cgi.

bradypus
  • 399
  • 3
  • 18