Path specified --php_executable_path does not exist -- GAE php HelloWorld - php

Setup the GAE PHP sandbox on my Linux laptop (running Debian 'Wheezy' 32-bit, latest packages). Setup was done following the 'Installing the SDK' instructions, followed by an attempt at the 'Getting-Started > Hello World' application, following the instructions.
However, when I visit http://local.host.com:8080*, I get the following message, instead of 'Hello World!':
The path specified with the --php_executable_path flag () does not exist.
*Note: SO doesn't allow URL pointing to localhost, so replaced it with local.host.com! It is not a mistake.
On the console where I'd started the app_server, I see the following error-message:
ERROR 2014-04-29 03:34:36,219 php_runtime.py:223] The PHP runtime is not available
Traceback (most recent call last):
File "/home/icarus/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 219, in new_instance
self._check_environment(php_executable_path)
File "/home/icarus/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 148, in _check_environment
'flag (%s) does not exist.' % php_executable_path)
_PHPBinaryError: The path specified with the --php_executable_path flag () does not exist.
Note that I've installed the latest php-5.4.27 (instructions talk of php-5.4.25, but later go on to say in a NOTE that we can get the latest from PHP website), and built it on my machine, successfully as per instructions.
Is the php-5.4.25 hardcoded anywhere, s.t. it is not found, as on my machine I've got php-5.4.27 ? Here is what I see:
$ ls -l ~/php-5.4.27/installdir/bin/php-cgi
-rwxr-xr-x 1 icarus icarus 23195302 Apr 28 22:58 php-cgi
Python installed is 2.7.3, and the google_appengine SDK is latest stable i.e. 1.9.3.

Argh... I ignored to see the plethora of questions already on SO, on this (or nearly this) subject, most perhaps from newbies like me.
Based on this other SO question's answer, I started the SDK like this:
$ google_appengine/dev_appserver.py --php_executable_path=php-5.4.27/installdir/bin/php-cgi work/gae_apps/helloworld/
and finally 'Hello World!' worked as expected. Perhaps, this calls for bit of clarification / elaboration on the 'Getting Started' page ?

Related

unable to use dev_appserver.py to run the local development server on mac

I was following the tutorial on Google cloud platform to run the local server for the hello-world app, and using the dev_appserver.py command, however, the terminal complain with the message as below:
$ dev_appserver.py .
INFO 2016-10-22 21:59:53,084 devappserver2.py:769] Skipping SDK update check.
INFO 2016-10-22 21:59:53,129 api_server.py:205] Starting API server at: http://localhost:56857
INFO 2016-10-22 21:59:53,133 dispatcher.py:197] Starting module "default" running at: http://localhost:8080
INFO 2016-10-22 21:59:53,137 admin_server.py:116] Starting admin server at: http://localhost:8000
ERROR 2016-10-22 21:59:54,141 php_runtime.py:348] The PHP runtime is not available
Traceback (most recent call last):
File "/Users/Dale/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 344, in new_instance
self._check_binaries(php_executable_path, gae_extension_path)
File "/Users/Dale/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 265, in _check_binaries
raise _PHPBinaryError('The development server must be started with the '
_PHPBinaryError: The development server must be started with the --php_executable_path flag set to the path of the php-cgi binary.
what does the complain mean? Is there anything wrong with the php_runtime.py? and how can i set it straight? Thank you so much.
If you're on a Mac, you need to run this command:
gcloud components install app-engine-php-darwin
If you're on Linux, you need to provide --php_executable_path as the error message states.

Unable to run google app engine script with PHP

So, I'm trying to run the Hello World script but whenever I run dev_appserver.py I hit a wall.
Here's the error log from the script:
$ appengine/dev_appserver.py --php_executable_path=/usr/local/bin/php-cgi HelloWorld
...
ERROR 2016-03-29 12:57:30,588 php_runtime.py:348] The PHP runtime
is not available Traceback (most recent call last): File
"/Users//desktop/appengine/google/appengine/tools/devappserver2/php_runtime.py",
line 344, in new_instance
self._check_binaries(php_executable_path, gae_extension_path) File
"/Users//desktop/appengine/google/appengine/tools/devappserver2/php_runtime.py",
line 284, in _check_binaries
cls._check_environment(php_executable_path, env) File "/Users//desktop/appengine/google/appengine/tools/devappserver2/php_runtime.py",
line 259, in _check_environment
raise _PHPEnvironmentError(check_process_stdout)
_PHPEnvironmentError: No input file specified.
As a background to my El Capitan setup...
I've previously updated PHP to 5.5 using:
curl -s http://php-osx.liip.ch/install.sh | bash -s 5.5
But I've also downloaded via HomeBrew php54 and that's what should be running the php-cgi script I've posted in the executable path above.
Any thoughts?
So turns out, the answer was pretty obvious - I'd installed the Go SDK rather than the PHP one! Google's website scrolls to the wrong place when you click PHP. Many hours wasted trying to fix this one - never mind. Hope this helps another as simple as me!
if you already installed google-cloud-sdk run this command :
gcloud components install app-engine-php-darwin
you won't need to specify that path after this

GAE - php5.5 - The PHP runtime is not available

I am trying to run a helloworld gae php program locally, but get error when I start the server.
My environment:
linux mint mate 17 php5.5 php-cgi5.5 python2.7.6 gae_php_1.9.17
The error info I get when try to start web server in gae locally:
INFO 2015-02-08 16:17:32,197 api_server.py:172] Starting API server at: http://localhost:54892
INFO 2015-02-08 16:17:32,201 dispatcher.py:186] Starting module "default" running at: http://localhost:8080
INFO 2015-02-08 16:17:32,202 admin_server.py:118] Starting admin server at: http://localhost:8000
ERROR 2015-02-08 16:17:33,204 php_runtime.py:227] The PHP runtime is not available
Traceback (most recent call last):
File "/mnt/star/program/gae/gae_php_1.9.17/google/appengine/tools/devappserver2/php_runtime.py", line 223, in new_instance
self._runtime_config_getter().application_root)
File "/mnt/star/program/gae/gae_php_1.9.17/google/appengine/tools/devappserver2/php_runtime.py", line 148, in _check_environment
'flag (%s) does not exist.' % php_executable_path)
_PHPBinaryError: The path specified with the --php_executable_path flag () does not exist.
Any suggestion?
Looks like you're not passing --php_executable_path (it's showing up as an empty string, its default). Running:
dev_appserver.py --php_executable_path=/usr/bin/php-cgi yourapp
may therefore work better for you.

WordPress not running in local environment, developed for Google app engine

I have installed the WordPress, MySQL,PHP SDK on Linux (Ubuntu 13.10) and configure everything according to google-appengine-help-page
But, I can't access the wordpress in local environment also after the deployment.
when I run the following, in the terminal, from my home directory, where APPLICATION_DIRECTORY IS prsent
google_appengine/dev_appserver.py APPLICATION_DIRECTORY
I get error , the output is....
INFO 2014-04-14 05:55:59,407 sdk_update_checker.py:242] Checking for updates to the SDK.
INFO 2014-04-14 05:56:00,904 sdk_update_checker.py:258] Update check failed: HTTP Error 404: Not Found
INFO 2014-04-14 05:56:00,927 api_server.py:171] Starting API server at: http://localhost:44134
INFO 2014-04-14 05:56:00,952 dispatcher.py:182] Starting module "default" running at: http://localhost:8080
ERROR 2014-04-14 05:56:00,953 php_runtime.py:223] The PHP runtime is not available
Traceback (most recent call last):
File "/home/hkc/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 219, in new_instance
self._check_environment(php_executable_path)
File "/home/hkc/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 148, in _check_environment
'flag (%s) does not exist.' % php_executable_path)
_PHPBinaryError: The path specified with the --php_executable_path flag () does not exist.
INFO 2014-04-14 05:56:00,954 admin_server.py:117] Starting admin server at: http://localhost:8000
The error shows that php_executable_path does not exist. I have the php-5.4.25, google-appengine, APPLICATION_DIRECTORY all under my, home directory.
When I open localhost:8080 (added http:// before that), it shows,
The path specified with the --php_executable_path flag () does not exist.
How can I correct this ?
The --php_executable_path should point to a php-cgi installed with Ubuntu. This is likely somewhere like /usr/bin/php5-cgi

No input file error from dev_appserver.py

I am trying to create a helloworld GAE projects to use PHP to connect to a Google Cloud SQL database. I am following the steps found at:
https://developers.google.com/appengine/docs/php/gettingstarted/helloworld
However, whenever I start the dev_appserver.py to test my helloworld.php I eventually get a permission denied error. I am running Cygwin (mintty) on a Win8 (64) machine. I have run chmod -R 777 * on a number of related directories like:
/usr/bin/
c:/Development/appengine-php-sdk-1.8.0/
c:/Development/php/
c:/Development/Php Scripts/helloworld/
Error:
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 504, in run
self.__target(*self.__args, **self.__kwargs)
File "/cygdrive/c/Development/appengine-php-sdk-1.8.0/google_appengine/google/appengine/tools/devappserver2/server.py", line 1232, in _loop_adjusting_instances
self._adjust_instances()
File "/cygdrive/c/Development/appengine-php-sdk-1.8.0/google_appengine/google/appengine/tools/devappserver2/server.py", line 1209, in _adjust_instances
self._add_instance(permit_warmup=True)
File "/cygdrive/c/Development/appengine-php-sdk-1.8.0/google_appengine/google/appengine/tools/devappserver2/server.py", line 1087, in _add_instance
expect_ready_request=perform_warmup)
File "/cygdrive/c/Development/appengine-php-sdk-1.8.0/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 195, in new_instance
self._check_environment(php_executable_path)
File "/cygdrive/c/Development/appengine-php-sdk-1.8.0/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 138, in _check_environment
env={})
File "/cygdrive/c/Development/appengine-php-sdk-1.8.0/google_appengine/google/appengine/tools/devappserver2/safe_subprocess.py", line 61, in start_process
stdin=subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1248, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
How can I determine what file the permission issue is with?
EDIT
There is no traceback from this new error (now that I am calling the actual exe):
WARNING 2013-06-04 02:21:13,243 api_server.py:329] Could not initialize images API; you are likely missing the Python "PIL" module.
INFO 2013-06-04 02:21:13,252 api_server.py:153] Starting API server at: http://localhost:51615
INFO 2013-06-04 02:21:13,261 dispatcher.py:164] Starting server "default" running at: http://localhost:8080
INFO 2013-06-04 02:21:13,324 admin_server.py:117] Starting admin server at: http://localhost:8000
ERROR 2013-06-04 02:21:13,553 php_runtime.py:199] The PHP runtime is not available because: No input file specified.
Then when I go to localhost:8080 I get this:
`The PHP interpreter specified with the --php_executable_path flag ("/cygdrive/c/Development/php/php-cgi.exe") is not compatible with the App Engine PHP development environment.
No input file specified.`
The problem is in your command line:
appengine-php-sdk-1.8.0/google_appengine/dev_appserver.py --php_executable_path=/cygdrive/c/Development/php/ /cygdrive/c/Development/PhpScripts/helloworld/
Your php_executable_path is not an executable, but a directory. So, GAE tries to run /cygdrive/c/Development/php/ as if it were a program, and gets an EACCES ("permission denied"), exactly as it should.
The fix is to pass /cygdrive/c/Development/php/php.exe (or whatever it's called) instead.
I believe your new problem is exactly what I mentioned in an early comment, and in the earlier version of this answer: You're mixing cygwin and native code in ways that don't work.
In particular, it looks like you're running a native Windows version of GAE in a cygwin Python interpreter, and then pointing it at a native Windows php-cgi interpreter. It's hard to guess exactly which one of these multiple mismatches is to blame, but it's quite likely that one of them is. So, either:
Use a native Windows Python, or
Use a cygwin/POSIX GAE and a cygwin PHP interpreter.

Categories