Anwar Mohamed
Anwar Mohamed

Reputation: 653

mongoose is not working with php-cgi

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?

Upvotes: 0

Views: 4240

Answers (2)

vonnyfly
vonnyfly

Reputation: 7

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!

Upvotes: 1

Julian Bogdani
Julian Bogdani

Reputation: 399

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.

Upvotes: 0

Related Questions