Starting the server on MAC OS X

I will figure out how to use php-openId https://github.com/openid/php-openid

So, I cloned the repo on my system in the ~ / www directory. There are some examples in the php-open-id / examples directory that need to be run.

In particular, I wanted to display the php-open-id / examples / consumer / index.php page to go forward in understanding api.

So, to display the page, I started the server in the php-open-id / examples directory using

python -m SimpleHTTPServer 8000 

And I switched to localhost: //consumer/index.php

But that does not work. A dialog box appears to save the file. Say someone tells me the correct way to render this php file.

+5
source share
2 answers

I found a solution:

Start the server using

 php -S localhost:9000 
+20
source

You must have a php server to serve .php files. A simple python server is not a php server, so it just lists the files in the directory to download.

If you are on OSX 10 or higher, it comes with apache, which has a php module and can be configured to serve a php file.

The tutorials can be found here http://php.net/manual/en/install.macosx.bundled.php and here https://discussions.apple.com/docs/DOC-3083

If you want to configure a dedicated server instead of using apache, MAMP is a good solution. Google This and see the setup guide.

+2
source

Source: https://habr.com/ru/post/1235766/


All Articles