Trying to get joomla working locally and ran into an issue with the Administror page. I have this error,
home page of site works - www.my-site.index.php
but with admin I find the following error - www.my-site/administrator.index.php
Warning: require(/Users/RichardClark/Sites/demo-test2/joomla/administrator): failed to open stream: No such file or directory in /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/php/setup.php on line 115
Fatal error: require(): Failed opening required '/Users/RichardClark/Sites/demo-test2/joomla/administrator' (include_path='/Users/RichardClark/Sites/demo-test2:/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/php/sdk') in /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/php/setup.php on line 115
I get the impressions joomla and google app engine aren't very compatible. I am really struggling to debug this. My app.yaml file is as follows;
application: fit-rig-517
version: 1
runtime: php
api_version: 1
handlers:
- url: /joomla/(.*\.(htm$|html$|css$|js$))
static_files: joomla/\1
upload: joomla/(.*\.(htm$|html$|css$|js$))
application_readable: true
## Admin
- url: /administrator(.+)
script: joomla/administrator\1
## Asset folders
- url: /media
static_dir: joomla/media
application_readable: true
mime_type: text/html
- url: /images
static_dir: joomla/images
application_readable: true
## Template folders
- url: /templates
static_dir: joomla/templates
application_readable: true
mime_type: application/(htm$|html$|css$|js$)
- url: /administrator/templates
static_dir: joomla/administrator/templates
application_readable: true
mime_type: text/html
## SEO robots
- url: /robots.txt
script: joomla/robots.txt
## Site access
- url: /(.+)?/?
script: joomla/index.php
thanks
App Engine does not have the concept of a default script (e.g. index.php) for directory access. Instead, it relies on the following rule in your app.yaml to locate the php script.
## Admin
- url: /administrator(.+)
script: joomla/administrator\1
Use /administrator/index.php to access your admin page instead.
Related
I am learning how to move my existing PHP project to gCloud.
For the same, I created an AppEngine project and have placed my code there.
Everything seems to work except the PHP files.
When I launch my project, the index files launches (as specified in app.yaml) and then where the PHP should execute, it's renders the index.html file. This creates a deadly loop of index calling PHP calling index calling PHP :(
I am sure I have my app.yaml wrong, but am unable to figure out where the problem is.
My yaml looks like this:
runtime: php55
api_version: 1
threadsafe: true
handlers:
- url: /dialpad_research/(.*\.(appcache|manifest))
mime_type: text/cache-manifest
static_files: dialpad_research/static/\1
upload: dialpad_research/static/(.*\.(appcache|manifest))
- url: /dialpad_research/static
static_dir: dialpad_research/static
# image files
- url: /dialpad_research/static/(.*\.(bmp|gif|ico|jpeg|jpg|png))
static_files: static/\1
upload: static/(.*\.(bmp|gif|ico|jpeg|jpg|png))
# dialpad root
- url: /dialpad_research.*
static_files: dialpad_research/static/index.html
upload: dialpad_research/static/index.html
- url: /dialpad_research/api/(.+\.php)$
script: api/\1
Any help is appreciated.
Folder structure is like this:
Root
|
---- app.yaml
---- dialpad_research (folder)
|
---- static (folder with index file)
---- api (folder with PHP files)
You have to be careful with your regex matching. This url pattern:
- url: /dialpad_research/static
will match:
- url: /dialpad_research/static(anything to follow)
So, it will never get to the handler below:
- url: /dialpad_research/static/(.*\.(bmp|gif|ico|jpeg|jpg|png))
Same for:
- url: /dialpad_research.*
After that, it can never get to:
- url: /dialpad_research/api/(.+\.php)$
Reorder your handlers so that they don't short-circuit.
Next, /api/ and /static/ are not at the root so your paths to them are incorrect. See below:
handlers:
- url: /dialpad_research/(.*\.(appcache|manifest))
mime_type: text/cache-manifest
static_files: dialpad_research/static/\1
upload: dialpad_research/static/(.*\.(appcache|manifest))
# image files
- url: /dialpad_research/static/(.*\.(bmp|gif|ico|jpeg|jpg|png))
static_files: dialpad_research/static/\1
upload: dialpad_research/static/(.*\.(bmp|gif|ico|jpeg|jpg|png))
- url: /dialpad_research/api/(.+\.php)$
script: dialpad_research/api/\1
- url: /dialpad_research/static
static_dir: dialpad_research/static
# dialpad root
- url: /dialpad_research.*
static_files: dialpad_research/static/index.html
upload: dialpad_research/static/index.html
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 install an old kind of framework (Social Engine 4) which is using Zend Framework 1 on its core.
Fatal error: require(): Failed opening required
'google/appengine/ext/cloud_storage_streams/CloudStorageClient.php'
(include_path=':PEAR:.')
in
/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/php/sdk/google/appengine/runtime/autoloader.php
on line 549
I'm using the Google App Launcher in mac and also I'm assuming the all google app engine related sdk's are automatically loaded by the autoloader.php
Has anyone encountered this kind of error in Google App Engine?
app.yml config:
application: application-id
version: 1
runtime: php55
api_version: 1
handlers:
- url: /install/(.*\.(htm|html|css|js))$
static_files: install/\1
upload: install/.*\.(htm|html|css|js)$
application_readable: true
- url: /install/(.*\.(jpg|png))$
static_files: install/\1
upload: install/.*\.(jpg|png)$
application_readable: true
- url: /install/index.php
script: install/index.php
- url: /(.+)?/?
script: index.php
I developed a web application the usual way and hosted on a normal shared server.
These are what I mean by usual
Include my PHP function files (using php include/require)
Use my normal MySQL database with msqli
Upload my files normally to the server using FTP.
For some reasons, I need to move the web app to appengine, I have succeeded in uploading the files but it shows me this error:
500 Server Error
with this error in my log:
Traceback (most recent call last):
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 239, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 298, in _LoadHandler
handler, path, err = LoadObject(self._handler)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 84, in LoadObject
obj = __import__(path[0])
ImportError: No module named index
What changes do I need to make to my files to enable my website work well on appengine without issues?
EDIT (Content of app.yaml)
application: gcdc2013-myworkset
version: 1
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: .*
script: index.php
- url: /css
static_dir: stylesheets
- url: /images
static_dir: images
libraries:
- name: webapp2
version: "2.5.2"
I tried changing runtime to php but it gave an error which cleared immediately i changed it back to python27
EDIT:
Updated app.yaml file (Project deploys now but shows this error for all PHP files: Could not guess mimetype for excel/excel_reader.php. Using application/octet-stream.
Also the project appears as blank when viewed on the browser):
application: gcdc2013-myworkset
version: 1
runtime: php
api_version: 1
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: .*
script: index.php
- url: /
script: index.php
- url: /index\.php
script: index.php
- url: /features
script: features/index.php
- url: /about
script: about/index.php
- url: /oauth2callback/?
script: signup.php
- url: (.*)\.[\d]{10}\.(css|js)
static_files: $1.$2
upload: (.*).(.*)
- url: /css
static_dir: css
- url: /js
static_dir: js
Also, how can I import mysql database that I exported from my localhost to the appengine?
Change:
runtime: python27
To:
runtime: php
And remove:
libraries:
- name: webapp2
version: "2.5.2"
See https://developers.google.com/appengine/docs/php/config/appconfig for more information.
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).