I am figuring out how to use PHP OpenId
我正在弄清楚如何使用PHP OpenId
I have cloned the repo to the ~/www
directory. There are some examples in the php-open-id/examples
directory which I wanted to run.
我已将repo克隆到〜/ www目录。 php-open-id / examples目录中有一些我想运行的例子。
Specifically, I wanted to render the page php-open-id/examples/consumer/index.php
in order to better understand the API. I started a server in the php-open-id/examples
directory using
具体来说,我想渲染页面php-open-id / examples / consumer / index.php以便更好地理解API。我在php-open-id / examples目录中启动了一个服务器
python -m SimpleHTTPServer 8000
and I navigated to localhost://consumer/index.php
然后我导航到localhost://consumer/index.php
But it didn't work. It shows a dialog box to save the file. What is the correct way to render this PHP file?
但它没有用。它显示一个用于保存文件的对话框。呈现此PHP文件的正确方法是什么?
2 个解决方案
#1
37
I have found a solution :
我找到了一个解决方案:
Run the server using
使用运行服务器
php -S localhost:9000
#2
2
You need to have a php server for serving .php files. The simple python server is not a php server and therefore it is just simply listing the files in the directory for download.
你需要有一个PHP服务器来提供.php文件。简单的python服务器不是php服务器,因此它只是简单地列出目录中的文件以供下载。
If you are on OSX 10 or above, it comes with apache which has php module present and can be setup to serve php file.
如果你在OSX 10或更高版本,它附带apache,它有php模块存在,可以设置为服务php文件。
Tutorials can be found here http://php.net/manual/en/install.macosx.bundled.php and here https://discussions.apple.com/docs/DOC-3083
可以在http://php.net/manual/en/install.macosx.bundled.php和https://discussions.apple.com/docs/DOC-3083找到教程。
If you would like to setup a dedicated server instead of using apache, MAMP is a good solution. Google It and see tutorials on how to set it up.
如果您想设置专用服务器而不是使用apache,MAMP是一个很好的解决方案。谷歌它,并看到有关如何设置它的教程。
#1
37
I have found a solution :
我找到了一个解决方案:
Run the server using
使用运行服务器
php -S localhost:9000
#2
2
You need to have a php server for serving .php files. The simple python server is not a php server and therefore it is just simply listing the files in the directory for download.
你需要有一个PHP服务器来提供.php文件。简单的python服务器不是php服务器,因此它只是简单地列出目录中的文件以供下载。
If you are on OSX 10 or above, it comes with apache which has php module present and can be setup to serve php file.
如果你在OSX 10或更高版本,它附带apache,它有php模块存在,可以设置为服务php文件。
Tutorials can be found here http://php.net/manual/en/install.macosx.bundled.php and here https://discussions.apple.com/docs/DOC-3083
可以在http://php.net/manual/en/install.macosx.bundled.php和https://discussions.apple.com/docs/DOC-3083找到教程。
If you would like to setup a dedicated server instead of using apache, MAMP is a good solution. Google It and see tutorials on how to set it up.
如果您想设置专用服务器而不是使用apache,MAMP是一个很好的解决方案。谷歌它,并看到有关如何设置它的教程。