Unable to Install Wordpress on Google App Engine - php

I followed this tutorial to set up Wordpress on Google App Engine:
http://googlecloudplatform.github.io/appengine-php-wordpress-starter-project/
I run the application in the GAE Launcher, then go to this address:
http://localhost:8080/wp-admin/install.php
This should run the Wordpress installer. However, it simply displays "Hello world!"
Here is the Launcher log:
*** Running dev_appserver with the following flags:
--skip_sdk_update_check=yes --port=8080 --admin_port=8000
Python command: /usr/bin/python2.7
INFO 2014-09-23 22:06:18,670 devappserver2.py:725] Skipping SDK update check.
WARNING 2014-09-23 22:06:18,673 api_server.py:383] Could not initialize images API; you are likely missing the Python "PIL" module.
INFO 2014-09-23 22:06:18,676 api_server.py:171] Starting API server at: http://localhost:52328
INFO 2014-09-23 22:06:18,680 dispatcher.py:183] Starting module "default" running at: http://localhost:8080
INFO 2014-09-23 22:06:18,684 admin_server.py:117] Starting admin server at: http://localhost:8000
INFO 2014-09-23 22:06:38,979 module.py:652] default: "GET /wp-admin/install.php HTTP/1.1" 200 12

It sounds like instead of finding the correct project in the starter project folder, it created a new project (the "Hello world!" you see is the default when you create a new project with no content), possibly in a subdirectory of your starter project folder. Try removing your project from the app engine launcher, and then dragging the folder with the project files into the app engine launcher project list pane (which should cause it to be created as a project).

Related

symfony2 assets targets the /www server folder, not the /web symfony folder when deploy in production

I have some problems with Symfony 2 application deployment. I have import all files I need on my OVH shared server, but some errors occured like css and js files not found (internal server error for example) or error like Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://my-server/css/458dafd_bootstrap-theme.min_1.css".
Notice that I have installed the CoresphereBundle in order to have a console in my browser when my application is iploaded on my server, I have access to the console only on dev environment.
This is step by step what I did in order to deploy my application:
1 I updated my application and vendors with composer (because I have no ways to install composer on my server)
composer.phar update
2 I clear the dev cache php app/console cache:clear
3 I clear the prod cache php app/console cache:clear --env=prod --no-debug
4 I install assets php app/console assets:install web
5 I dump the assets php app/console assetic:dump web
6 I uploaded my symfony application on my server.
7 Once the files are uploaded in web/app.php I I authorize
the prod debug
$kernel = new AppKernel('prod', true);
8 Then in web/config.php I remove this block
// …
if (!in_array(#$_SERVER['REMOTE_ADDR'], array(
'127.0.0.1',
'::1',
))) {
header('HTTP/1.0 403 Forbidden');
exit('This script is only accessible from localhost.');
}
So, on my server, if I would like to go to http://my-server/web/config.php it works well, so I see if my server is compatible with symfony. the only thing that appears is Set short_open_tag to off in php.ini*.
9 I set the access rights for the app/cache and app/log folders to 777 on my server, it allows the applications to write in these folders.
10 In web/app_dev.php I write this code, in order to allow the dev mode for my IP adress and so have access to the console bundle
// …
if (!in_array(#$_SERVER['REMOTE_ADDR'], array(
'127.0.0.1',
'::1',
'121.457.719.2' //a random ip adress it's just for you to understand
))) {
header('HTTP/1.0 403 Forbidden');
exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}
11 So I have access to the dev environment on my server, all works well, and no errors occured here. To access to the console bundle, following to the bundle documentation, I have to wrote http://my-server/web/app_dev.php/_console (see the routing code here):
_console:
resource: "#CoreSphereConsoleBundle/Resources/config/routing.yml"
prefix: /_console
But this routes does not exist, If I wrote this url, nothing appear in my browser:
However, by the config.php, I have access to app_dev.php by following the Bypass configuration and go to the Welcome page link:
I click on the link and I arrived on app_dev.php. Like I said before, no errors occured in this environment, except for the console route. But I could have access to the console by clicking on the console logo under the symfony debug toolbar:
This is the url for the console when I click on the logo under symfony debug toolbar: http://my-server/web/app_dev.php//_console/_console, I would like to understand why?
Then when I would like to make some commands another error occured: [error] Internal Server Error in the console:
If I try to use the router debug php app/console debug:router, I have this:
and with the php app/console debug:router | grep _console:
So, there are the problems I have with my symfony application.
UPDATE
I resolved the problem of the console bundle. In fact my server does not use the same php version of my symfony application, I have to set this in the .ovhconfig at the root of my /www folder.
/www/.ovhconfig:
app.engine=php
app.engine.version=5.5
http.firewall=none
environment=production
Now when I would like to access to the production environment I have these errors concerning all my assets files (css/js/images, a 404 not found):
Failed to load resource: the server responded with a status of 404 (Not Found) -> http://my-server.com/bundles/fosjsrouting/js/router.js
Uncaught ReferenceError: fos is not defined -> routing:1
Failed to load resource: the server responded with a status of 404 (Not Found)
->http://my-server.com/css/45898d_dataTables.min_7.css
I don't really understand, the files are indeed at the root of the app, e-g I have no folder css or js or etc in http://my-server.com/. These folders are in http://my-server.com/web/. Where is the problem?
When I access to the console, this is the command I made:
1 cache:clear
2 assets:install web
3 assetic:dump web
EDIT: solution works
I understand that the assets target a /css /js /images etc folder at the root of my server, so I replace the css and js files to the root of the /www server folder, e-g in the /www folder of my server I have this:
//my server
/.ssh
/www /*http://my-server.com/...*/
/app/
/bin/
/css/
/fonts/
/images/
/js/
/src/
/vendor/
/web/
/.htaccess
/.ovhconfig
/composer.json
/composer.lock
/composer.phar
Why my symfony application tagets the assets here?
Have you tried to use the Symfony command line routing debugger?
php app/console debug:router
That will output all the routes the symfony app knows about and you could try piping it into grep to see if you're trying to use the wrong path to hit the _console route.
php app/console debug:router | grep _console

Deploy PHP using cURL in GAE

I just received a great news that full cURL is supported now.
I followed the instruction to replace "runtime:php" with "runtime:php55" in app.yaml and deployed my php code to Google App Engine using Google App Engine Launcher.
The system responsed error as attached:
..deploy response...............
2015-02-27 23:01:52 Running command: "['C:\\python27_x64\\pythonw.exe', '-u', 'C:\\Program Files\\Google\\Cloud SDK\\google-cloud-sdk\\platform\\google_appengine\\appcfg.py', '--no_cookies', u'--email=jihshiun#gmail.com', '--passin', 'update', 'D:\\Documents\\GAE CloudSite\\Hi']"
Usage: appcfg.py [options] update <directory> | [file, ...]
appcfg.py: error: Error parsing D:\Documents\GAE CloudSite\Hi\app.yaml: Unable to assign value 'php55' to attribute 'runtime':
Value 'php55' for runtime does not match expression '^(?:contrib-dart|dart|go|php|python|python27|java|java7|vm|custom)$'
in "D:\Documents\GAE CloudSite\Hi\app.yaml", line 3, column 10.
2015-02-27 23:02:04 (Process exited with code 2)
.......................
I also tried to add a php.ini with extension = "curl.so" in the file, and the deployment failed too with the same response.
Have I missed something?
Please advise.
I've had the same problem.
You have to update the sdk, download the file corresponding to your plataform and instal it.

Eclipse Makegood PHPUnit repository can't read

I've been trying to install Makegood in Eclipse juno.
But I can't read the repository for Makegood.
it shows an error in eclipse like
Unable to read repository at http://eclipse.piece-framework.com.
http://eclipse.piece-framework.com is not a valid repository location.
When Im trying to access the URL in browser it returns a forbidden message.
Forbidden
You don't have permission to access / on this server
Apache/2.2.14 (Ubuntu) Server at eclipse.piece-framework.com Port 80
Is there any other locations available for Makegood for PHPUnit testing on Eclipse juno?
You must copy this link and paste in Eclipse>Help>Install new software>Add...>
Name: EclipsePieceFramework (or anything)
Location: http://eclipse.piece-framework.com
And then select your new worksite (EclipsePieceFramework (or anything)) and check MakeGood.
http://piece-framework.com/projects/25/wiki/MakeGood_User_Guide_1_3_0#MakeGood-User-Guide

Starting Google App Engine Web Server

I'm going through the helloworld tutorial for Google App Engine using PHP (https://developers.google.com/appengine/docs/php/gettingstarted/helloworld). After getting the application set up and ready to go the tutorial tells me to start the web server included with the Google App Engine SDK using the command: google_appengine/dev_appserver.py --php_executable_path= helloworld/. How exactly do I start the web server and where do I put that command in?
After you install the SDK on your machine you'll have a google_appengine directory. I run Windows so mine is located at:
C:\Program Files (x86)\Google\google_appengine
Inside that directory is a python script called "dev_appserver.py" which is what the tutorial wants you to run. Your local machine should also have PHP installed and the script is looking for the location to that since it would be something you'd install yourself.
You'll execute this script from whatever local command line application your OS has (shell for Linux, terminal in Mac, Command Prompt or Powershell in Windows).
I execute mine from the folder one level above my GAE application is stored. To ensure you can properly execute this command, run it with no parameters and you should see this:
python "C:\Program Files (x86)\Google\google_appengine\dev_appserver.py"
Output:
usage: dev_appserver.py [-h] [--host HOST] [--port PORT]
[--admin_host ADMIN_HOST] [--admin_port ADMIN_PORT]
[--auth_domain AUTH_DOMAIN] [--storage_path PATH]
[--log_level {debug,info,warning,critical,error}]
[--max_module_instances MAX_MODULE_INSTANCES]
[--use_mtime_file_watcher [USE_MTIME_FILE_WATCHER]]
[--threadsafe_override THREADSAFE_OVERRIDE]
[--php_executable_path PATH]
[--php_remote_debugging [PHP_REMOTE_DEBUGGING]]
[--python_startup_script PYTHON_STARTUP_SCRIPT]
[--python_startup_args PYTHON_STARTUP_ARGS]
[--blobstore_path BLOBSTORE_PATH]
[--mysql_host MYSQL_HOST] [--mysql_port MYSQL_PORT]
[--mysql_user MYSQL_USER]
[--mysql_password MYSQL_PASSWORD]
[--mysql_socket MYSQL_SOCKET]
[--datastore_path DATASTORE_PATH]
[--clear_datastore [CLEAR_DATASTORE]]
[--datastore_consistency_policy {consistent,random,time}]
[--require_indexes [REQUIRE_INDEXES]]
[--auto_id_policy {sequential,scattered}]
[--logs_path LOGS_PATH]
[--show_mail_body [SHOW_MAIL_BODY]]
[--enable_sendmail [ENABLE_SENDMAIL]]
[--smtp_host SMTP_HOST] [--smtp_port SMTP_PORT]
[--smtp_user SMTP_USER]
[--smtp_password SMTP_PASSWORD]
[--prospective_search_path PROSPECTIVE_SEARCH_PATH]
[--clear_prospective_search [CLEAR_PROSPECTIVE_SEARCH]]
[--search_indexes_path SEARCH_INDEXES_PATH]
[--clear_search_indexes [CLEAR_SEARCH_INDEXES]]
[--enable_task_running [ENABLE_TASK_RUNNING]]
[--allow_skipped_files [ALLOW_SKIPPED_FILES]]
[--api_port API_PORT]
[--automatic_restart [AUTOMATIC_RESTART]]
[--dev_appserver_log_level {debug,info,warning,critical,error}]
[--skip_sdk_update_check [SKIP_SDK_UPDATE_CHECK]]
[--default_gcs_bucket_name DEFAULT_GCS_BUCKET_NAME]
yaml_files [yaml_files ...]
dev_appserver.py: error: too few arguments
My command to get this working properly was:
python "C:\Program Files (x86)\Google\google_appengine\dev_appserver.py" --port 8082 --admin_port 8083 --php_executable_path "C:\Program Files (x86)\NuSphere\PhpED\php54\php-cgi.exe" helloworld\
I got this output in Powershell and was able to hit the local url and see "Hellow, World!"
INFO 2013-10-22 16:04:27,039 sdk_update_checker.py:245] Checking for updates to the SDK.
INFO 2013-10-22 16:04:28,368 sdk_update_checker.py:261] Update check failed: HTTP Error 404: Not Found
WARNING 2013-10-22 16:04:28,398 api_server.py:332] Could not initialize images API; you are likely missing the Python "PIL" module.
INFO 2013-10-22 16:04:28,405 api_server.py:139] Starting API server at: http://localhost:52150
INFO 2013-10-22 16:04:28,408 dispatcher.py:171] Starting module "default" running at: http://localhost:8082
INFO 2013-10-22 16:04:28,411 admin_server.py:117] Starting admin server at: http://localhost:8083
INFO 2013-10-22 16:04:31,980 module.py:608] default: "GET / HTTP/1.1" 200 13
INFO 2013-10-22 16:04:32,223 module.py:608] default: "GET /favicon.ico HTTP/1.1" 200 13
The Google cloud SDK comes with a Launcher in which you could add project files and examine the logs in the GUI. I used python code here but it should behave the same with php.
Go to Google App Engine Launcher -> Select File -> Add Existing Application -> Browse and select the root directory of your PHP/Python/Java/Go application -> Add -> Click Run button -> Click Logs
2014-12-30 01:02:57 Running command: "['C:\\Users\\gung13\\Anaconda\\pythonw.exe', 'C:\\Program Files\\Google\\Cloud SDK\\google-cloud-sdk\\platform\\google_appengine\\dev_appserver.py', '--skip_sdk_update_check=yes', '--port=9080', '--admin_port=8001', u'C:\\Users\\gung13\\Desktop\\appengine-try-python-flask']"
INFO 2014-12-30 01:02:57,874 devappserver2.py:745] Skipping SDK update check.
INFO 2014-12-30 01:02:57,903 api_server.py:172] Starting API server at: http://localhost:62234
INFO 2014-12-30 01:02:57,905 dispatcher.py:186] Starting module "default" running at: http://localhost:9080
INFO 2014-12-30 01:02:57,907 admin_server.py:118] Starting admin server at: http://localhost:8001
INFO 2014-12-30 01:03:21,677 module.py:718] default: "GET / HTTP/1.1" 200 13
INFO 2014-12-30 01:03:21,986 module.py:718] default: "GET /favicon.ico HTTP/1.1" 404 27

PHP SDK won't run my php-cgi

I'm trying get the helloworld example for the Google Appengine PHP SDK working, but I can't seem to get the dev_appserver to even run. This is the command line I use and the error I get:
$ /opt/google-appengine-php/dev_appserver.py --php_executable_path=/usr/bin/php-cgi src
INFO 2013-06-14 02:50:09,070 sdk_update_checker.py:244] Checking for updates to the SDK.
INFO 2013-06-14 02:50:09,331 sdk_update_checker.py:260] Update check failed: HTTP Error 404: Not Found
INFO 2013-06-14 02:50:09,458 api_server.py:138] Starting API server at: http://localhost:39069
INFO 2013-06-14 02:50:09,647 dispatcher.py:164] Starting server "default" running at: http://localhost:8080
INFO 2013-06-14 02:50:09,650 admin_server.py:117] Starting admin server at: http://localhost:8000
ERROR 2013-06-14 02:50:09,717 php_runtime.py:199] The PHP runtime is not available because: No input file specified.
The output from php-cgi -v is:
PHP 5.4.16 (cgi-fcgi) (built: Jun 7 2013 05:55:42)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
The output from whereis php-cgi is:
php-cgi: /usr/bin/php-cgi
I looked at the php_runtime.py file but I can't even find the string No input file specified so I'm stumped!
Anyone have any idea what the problem is?
EDIT: I just tried running fgrep -r 'No input file specified' * in the App Engine directory and nothing shows up!!!
EDIT 2: It seems the message No input file specified comes from the PHP interpreter, no the App Engine SDK. But I still have no idea why?! the app.yaml and helloworld.php files are in the same directory and are copied from the tutorial page.
It seems the problem is the way I installed my system. My /home directory is actually a symbolic-link to /var/home (I have two partitions: / and /var) but PHP has a directive to limit where it loads files from, open_basedir. By default it includes /home but PHP resolves symlinks so all my files were coming from /var/home and /var (or anything below) are not included.
So the solution is to replace /home with /var/home in the open_basedir directive of my /etc/php/php.ini file.
EDIT: Also, since I installed the AppEngine PHP SDK in /opt/google-appengine-php I had to add that directory to open_basedir too.

Categories