Problem when uploading php application which uses Wordpress
* version - 1.8.0
* language - php
* operating system - Windows 7
Update to the GAE shows the below error for many files. Tried renaming few files but the error pops for another file and so on. These are wordpress 3.5.1 files.
Error 400: --- begin server output ---
Invalid character in filename: __static__\wordpress/wp-includes/css/admin-bar.css
--- end server output ---
The app.yaml content:
-------------------------------------------
application: fargocricketclub
version: 1
runtime: php
api_version: 1
threadsafe: yes
handlers:
- url: /(.*\.(htm$|html$|css$|js$))
static_files: wordpress/\1
upload: wordpress/(.*\.(htm$|html$|css$|js$))
application_readable: true
- url: /wp-content/(.*\.(ico$|jpg$|png$|gif$))
static_files: wordpress/wp-content/\1
upload: wordpress/wp-content/(.*\.(ico$|jpg$|png$|gif$))
application_readable: true
- url: /(.*\.(ico$|jpg$|png$|gif$))
static_files: wordpress/\1
upload: wordpress/(.*\.(ico$|jpg$|png$|gif$))
- url: /wp-admin/(.+)
script: wordpress/wp-admin/\1
secure: always
- url: /wp-admin/
script: wordpress/wp-admin/index.php
secure: always
- url: /wp-login.php
script: wordpress/wp-login.php
secure: always
- url: /wp-cron.php
script: wordpress/wp-cron.php
login: admin
- url: /xmlrpc.php
script: wordpress/xmlrpc.php
- url: /(.+)?/?
script: wordpress/index.php
I believe that this is fixed in the 1.8.1 release of App Engine, using the solution proposed above to join the path using the OS specific path separator.
Issue seen in PHP & Python 1.8.1 deployments on Windows when using application_readable. Issue flagged: https://code.google.com/p/googleappengine/issues/detail?id=9558
Work around:
replaced os.path.join with posixpath.join in google\appengine\tools\appcfg.py
Related
My app.yaml as:
runtime: php55
api_version: 1
threadsafe: true
handlers:
- url: /
static_files: www/index.html
upload: www/index.html
- url: /(.*)
static_files: www/\1
upload: www/(.*)
as seen above static files are under www dir. and php files are under the vendor dir and its sub sirs. I have read all days doc. to understand this yaml file to able to understand but unfortunately not yet :) . So, html and all static files works perfect. but when ajax calls php with sending data to php. gives 404 error. It works good on local wamp server. main opening page is index.html under www . And its ok. All day I tested many variant to able to deploy php files. Not able yet.
mainProjectRoot>app.yaml ( only this file and two directory "www and vendor")
www/index.html
/css
/js
vendor/smsgonder.php
/mail.php
/../../more php files
At least I gave up to try more variant and I need help to set up app.yaml page. (except above variant all extra code I received always error and no deployment)
Any help will be much appretiated. Thanks in advance !
final app.yaml is
runtime: php55
api_version: 2
threadsafe: true
handlers:
- url: /(.+\.php)$
script: vendor/\1
- url: /
static_files: www/index.html
upload: www/index.html
- url: /(.*)
static_files: www/\1
upload: www/(.*)
EDIT
this is final app.yaml ... (for a while I have deployed php files and some are were woring . But again for some php I receive "POST 500 error "
in case I like to share final app.yaml file here.
runtime: php55
api_version: 2
threadsafe: true
handlers:
- url: /(.*).php
script: \1.php
- url: /
static_files: www/index.html
upload: www/index.html
- url: /(.*)
static_files: www/\1
upload: www/(.*)
Any help will be very much appreciated. How could be :)) I spent 5-6 days just for deploying finished app :)'
add this immediately after handlers:
- url: /(.*)\.php$
script: vendor/\1.php
This will serve all request ending with .php to the php files within the vendor folder
The handlers section for PHP scripts following the documentation Example (works for vendor subdirectories as well):
# Serve php scripts.
- url: /(.+\.php)$
script: \1
Note: indentation matters!
I'm trying to set up Google App Engine and Wordpress version 3.8 according to instruction at https://developers.google.com/appengine/articles/wordpress
But when I run $ APP_ENGINE_SDK_PATH/dev_appserver.py APPLICATION_DIRECTORY I have got the error
Unable to assign value 'wordpress/..(htm|html|css|js)$' to attribute
'upload:' value 'wordpress/..(htm|html|css|js)$' for upload does not
match expression '^(?:(?!\^).*(?!\$).)$' in app.yaml in line 9, column
11
Here is my app.yaml file's content:
application: thangvmwordpressdemo
version: 1
runtime: php
api_version: 1
handlers:
- url: /(.*\.(htm|html|css|js))$
static_files: wordpress/\1
upload: wordpress/.*\.(htm|html|css|js)$
application_readable: true
- url: /wp-content/(.*\.(ico|jpg|png|gif))$
static_files: wordpress/wp-content/\1
upload: wordpress/wp-content/.*\.(ico|jpg|png|gif)$
application_readable: true
- url: /(.*\.(ico|jpg|png|gif))$
static_files: wordpress/\1
upload: wordpress/.*\.(ico|jpg|png|gif)$
- url: /wp-admin/(.+)
script: wordpress/wp-admin/\1
secure: always
- url: /wp-admin/
script: wordpress/wp-admin/index.php
secure: always
- url: /wp-login.php
script: wordpress/wp-login.php
secure: always
- url: /wp-cron.php
script: wordpress/wp-cron.php
login: admin
- url: /xmlrpc.php
script: wordpress/xmlrpc.php
- url: /wp-(.+).php
script: wordpress/wp-\1.php
- url: /(.+)?/?
script: wordpress/index.php
Can you have me solve this problem?
Thank you so much!
As of 19 Jan 2014 that article doesn´t work with current Google App Engine for PHP SDK v1.8.9 (Windows). The problem is the final regex ending ($) of the handlers.upload attribute. I´m not sure why this has happened and when it will get fixed, however, you can try any of the following workarounds:
You have to either remove it:
handlers:
- url: /.*\.(htm|html|css|js)
static_files: wordpress/\1
upload: wordpress/.*\.(htm|html|css|js)
application_readable: true
or use the semantically equivalent (to the faulty one):
handlers:
- url: /.*\.(htm|html|css|js)
static_files: wordpress/\1
upload: wordpress/.*\.(htm$|html$|css$|js$)
application_readable: true
Cheers !!
The documentation was recently update to reflect changes made in the regex validation. The validation is done both by the SDK on the client side and on the server side (app engine). Please make sure you are using the 1.8.9 SDK (current), otherwise regex ending in $ will not work.
+1 to boombatower's comments; you might have better luck using the GitHub "Starter Project" for WordPress that we posted here: https://github.com/GoogleCloudPlatform/appengine-php-wordpress-starter-project
That article is tough to follow because there is such a difference between going through all those steps and just cloining a git project and getting on with it, and it's also updated less frequently because the git project is "crowdsourced" among several Googlers while the article is written by one writer with many other priorities.
Here's the app.yaml file from that project, for comparison:
https://github.com/GoogleCloudPlatform/appengine-php-wordpress-starter-project/blob/master/app.yaml
Also had this problem. You need to download the latest version of the appengine SDK for PHP. It's at 1.9.2 now. You can maintain separate versions if you still need the older version.
I'm running Apache and MySQL via XAMPP v1.8.2 to support a WordPress site for Google App Engine (GAE) local development and cloud deployment using GAE SDK v1.8.8.
Changing settings or stylings of the theme, which uses AJAX, does not save on the local server or the production server. The theme's settings and stylings though can be changed on a localhost not using GAE.
I've tried repairing and reinstalling GAE, WordPress and XAMPP so I reason it may be my server / DB setup or a GAE issue.
Launching the app via GAE Launcher's log displays the following error:
2013-12-26 09:30:03 Running command: "['C:\Program
Files\Python27\python.exe',
'C:\google_appengine\dev_appserver.py',
'--skip_sdk_update_check=yes', '--port=9080', '--admin_port=8001',
'C:\catalyx-GoogleAppEngine\catalyx']" 2013-12-26 09:30:03 (Process
exited with code -1073741515)
The site's app.yaml contains:
application: catalyx-wp
version: wp
runtime: php
api_version: 1
handlers:
- url: /(.*\.(htm$|html$|css$|js$))
static_files: wordpress/\1
upload: wordpress/(.*\.(htm$|html$|css$|js$))
application_readable: true
- url: /wp-content/(.*\.(ico$|jpg$|png$|gif$))
static_files: wordpress/wp-content/\1
upload: wordpress/wp-content/(.*\.(ico$|jpg$|png$|gif$))
application_readable: true
- url: /(.*\.(ico$|jpg$|png$|gif$))
static_files: wordpress/\1
upload: wordpress/(.*\.(ico$|jpg$|png$|gif$))
- url: /wp-admin/(.+)
script: wordpress/wp-admin/\1
secure: always
- url: /wp-admin/
script: wordpress/wp-admin/index.php
secure: always
- url: /wp-login.php
script: wordpress/wp-login.php
secure: always
- url: /wp-cron.php
script: wordpress/wp-cron.php
login: admin
- url: /xmlrpc.php
script: wordpress/xmlrpc.php
- url: /wp-(.+).php
script: wordpress/wp-\1.php
- url: /(.+)?/?
script: wordpress/index.php
Any suggestions are appreciated.
I am running Windows 8.1 64 bit on a core I7 laptop. I am running Python 2.7.6 with the GoogleAppEngine-1.8.7 installed. IIS 8.5 is also installed with the PHP manager extension
I have PHP 5.4.10 also installed in the C:\PHP directory
I had already created 3 Wordpress apps locally successfully (about a week ago) and when I ran them in the Google App Engine Launcher Browser everything was fine until 2 days ago.
Now when I start the apps and launch the browser on the locally host on port 8080 I get a blank screen.
This is the contents of the log file:
INFO 2013-11-12 04:31:39,665 dispatcher.py:171] Starting module "default" running at: http://locally host:8080
INFO 2013-11-12 04:31:39,667 admin_server.py:117] Starting admin server at: http://locally host:8000
INFO 2013-11-12 04:31:50,822 module.py:608] default: "GET / HTTP/1.1" 302 -
contents of app.yaml:
application: icefishingco
version: wp
runtime: php
api_version: 1
handlers:
- url: /(.*\.(htm$|html$|css$|js$))
static_files: wordpress/\1
upload: wordpress/(.*\.(htm$|html$|css$|js$))
application_readable: true
- url: /wp-content/(.*\.(ico$|jpg$|png$|gif$))
static_files: wordpress/wp-content/\1
upload: wordpress/wp-content/(.*\.(ico$|jpg$|png$|gif$))
application_readable: true
- url: /(.*\.(ico$|jpg$|png$|gif$))
static_files: wordpress/\1
upload: wordpress/(.*\.(ico$|jpg$|png$|gif$))
- url: /wp-admin/(.+)
script: wordpress/wp-admin/\1
secure: always
- url: /wp-admin/
script: wordpress/wp-admin/index.php
secure: always
- url: /wp-login.php
script: wordpress/wp-login.php
secure: always
- url: /wp-cron.php
script: wordpress/wp-cron.php
login: admin
- url: /xmlrpc.php
script: wordpress/xmlrpc.php
- url: /wp-(.+).php
script: wordpress/wp-\1.php
- url: /(.+)?/?
script: wordpress/index.php
Contents of cron.yaml
cron:
- description: wordpress cron tasks
url: /wp-cron.php
schedule: every 2 hours
contents of my php.ini:
google_app_engine.enable_functions = "php_sapi_name, gc_enabled"
System Environment variable:
Path=C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;c:\php;c:\python27;C:\Program Files (x86)\QuickTime\QTSystem\
What, if anything, am I doing wrong?
The http://locally host:8080 looks fishy in the log. Could you post the extra flags you used for the project as well?
I recently add wordpress to Google App Engine
Everything is working fine in the local PHP SDK
I used git it deploy the site to GAE, problem is in the live site admin area (wp-admin) one css and one js is not loading so I'm getting a display like this
I checked the missing resource they are
myappid.appspot../wp-admin/load-styles.php?c=0&dir=ltr&load=admin-bar,wp-admin,buttons,wp-auth-check&ver=3.6.1
and
myappid.appspot.../wp-admin/load-scripts.php?c=0&load%5B%5D=jquery-core,jquery-migrate,utils,json2&ver=3.6.1
These resources are loading fine in the local GAE PHP SDK. I'm using the same app.yaml that given in the google wordpress tutorial
I spend 2 days finding a solution for this Please help me out :)
This is my app.yaml file
application: entersys-wordpress
version: wp
runtime: php
api_version: 1
threadsafe: no
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: /(.*\.(htm$|html$|css$|js$))
static_files: wordpress/\1
upload: wordpress/(.*\.(htm$|html$|css$|js$))
application_readable: true
- url: /wp-content/(.*\.(ico$|jpg$|png$|gif$))
static_files: wordpress/wp-content/\1
upload: wordpress/wp-content/(.*\.(ico$|jpg$|png$|gif$))
application_readable: true
- url: /(.*\.(ico$|jpg$|png$|gif$))
static_files: wordpress/\1
upload: wordpress/(.*\.(ico$|jpg$|png$|gif$))
- url: /wp-admin/(.+)
script: wordpress/wp-admin/\1
secure: always
- url: /wp-admin/
script: wordpress/wp-admin/index.php
secure: always
- url: /wp-login.php
script: wordpress/wp-login.php
secure: always
- url: /wp-cron.php
script: wordpress/wp-cron.php
login: admin
- url: /xmlrpc.php
script: wordpress/xmlrpc.php
- url: /(.+)?/?
script: wordpress/index.php
I think there is a bug if you use git to deploy not correctly pushing the static content.
I would try using the appcfg.py method to push your app to check (Follow Step 8 here).