Google App Engine PHP on windows

I am trying to start by using the Google app engine using PHP (on Windows 7) and trying to follow the helloworld example here .

The problem is starting the web server. Whenever I try to run it, I get an error

dev_appserver.py: error: too few arguments 

I enter the following on the command line:

 google_appengine\dev_appserver.py --php_executable_path=c:\php\php-cgi c:\appengine\helloworld\ 

Any suggestions on what I'm doing wrong?

Greetings

+4
source share
6 answers

Use quotation marks for arguments.

 google_appengine\dev_appserver.py --php_executable_path="c:\php\php-cgi" "c:\appengine\helloworld" 

Or use slashes instead of backslashes as a directory separator:

 google_appengine\dev_appserver.py --php_executable_path=c:/php/php-cgi c:/appengine/helloworld 

Combine both methods for best results :)

+4
source

So, I ran into this problem and tried every permutation of the paths with quotes and switched to the directory where the appengine SDK was installed. Finally, I realized that Python was running the script, but it did not include the command line arguments passed. Therefore, I had to manually call python as follows:

 c:\<python_path>\python <sdk_path>/dev_appserver.py --php_executable_path=c:/php/php-cgi.exe helloworld/ 

I am not a guy from python, so I don’t know why the command line arguments were split, but I had this problem with other applications in Windows 7

+2
source

This answer solved the problem for me.

To clarify this a bit, here's how the meaning under

HKEY_CLASSES_ROOT\Applications\python.exe\shell\open\command

should look in regedit windows tool.

Regedit: Edit String Value

And it should be the same as the meaning under this path:

HKEY_CLASSES_ROOT\Python.File\shell\open\command

Solution tested in the environment: Python 2.7.5 on Windows 7 (home premium) x64.

In fact, I had this problem not with the PHP App Engine, but with the Go App Engine. However, apparently this is not an App Engine, but a Python + Windows problem.

+2
source

I also use Windows 7.

Here he checked my code:

dev_appserver.py --php_executable=c:/php/php-cgi.exe c:/appengine/helloworld

Note! I ended up in the google appengine directory.

For example, if you installed the SDK in C:

Write the first cd google_appengine press enter and then use the top code.

+1
source

You need to either: specify the full path to dev_appserver.py

or

cd to the directory in which you installed it

If you followed the example letter, you would install it in the C: / {username} / something directory

and the call will then be something / dev_appserver.py, as indicated in the example in helloworld!

Hovever - there is one mistake in the example: the directory they offer is not the one they use in the call example! This is why make sure that the "sometinhg" directory is the same in the call used to install the application engine

+1
source

after I moved everything to c: \ to simplify the paths that I ended up calling it from the dos command line, like this

C:> \ Python27 \ python C: /google_appengine/dev_appserver.py --php_executable_path = C: /php/php-cgi.exe c: / google_appengine / helloworld /

And it works!

is a python command line tool, how should we run this stuff?

0
source

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


All Articles