GAE - wordpress as a module inside a Python app - php

Google App Engine recently added support for modules. And I'm almost certain I remember someone saying you can have modules with different runtimes. Your default app can be Python and a module could be in Java or PHP for example. And the module configuration file does make you specify the runtime for that module.
So why then can I not figure out how to run a PHP module inside a Python app?
I have a dispatch.yaml that contains:
dispatch:
- url: "*/blog*"
module: blog
And a blog.yaml for the module which contains:
module: blog
version: wp
runtime: php
api_version: 1
and a bunch of handlers for Wordpress.
Has anyone else been able to do this successfully?
In this case I want to run a wordpress blog under http:/www.domain.com/blog instead of under a sub-domain for SEO reasons.
It seems the appengine SDK is not using the module because if I try to go to /blog it just gives me a 404 error.
I'll continue to play with this and post an update if I find a solution.

I have everything working now. Google fixed some issues in version 1.8.5 making this possible. It's actually not that hard, you just have to remember to run appcfg.py update_dispatch in order to make the dispatch routing live. And also when deploying do appcfg.py update app.yaml wordpress.yaml
That way both configurations are uploaded and deployed.
Currently git push to deploy is still broken and in order to upload images wordpress wp-admin has to be running on the appspot.com domain which is not too big of a deal.
I wrote a blog post describing everything that I did to make it work:
http://blog.artooro.com/2013/10/09/run-wordpress-as-a-module-on-google-app-engine/

Related

Google Cloud App Engine : Custom WordPress theme and plugins missing

Following this official guide and using the flex environment with php 7.2, I am trying to deploy to App Engine with custom plugins and themes.
These themes are not available on wppackagist, given that they are truly custom to my project.
My git repo is correctly saving the custom plugins and themes -- all composer.json based wppackagist plugins are being installed as intended.
However, for the life of me, I cannot get the deploy to include my custom files. I have additionally verified that the image uploaded to AE is the correct version, and it has been promoted to serve all traffic as intended.
Can anyone help me understand the logic that I am missing to ensure that when I deploy my app that the custom plugins and themes are built into the image?
So the answer is to not change the app output folder. Via the CLI install helper, I defined the output folder to wp_app -- it still anticipated app as the folder. Nothing was in the app folder when I created the service as wp_app being the WordPress folder. So, just keep the folder structure as-is and you will be fine.

Installed Symfony 3 demo project Not finding css or js files

I use composer to install symfony-demo. (It's symfony demo project for learning and teaching)
I'm using symfony-demo repository.
I'm on a windows machine. Running php 7.
Installed folder is c:\www\symfony-demo\
Apache is installed and c:\www is root folder.
loading http://localhost/symfony-demo/web works. The symfony application works.
However the assets like "/build/css/app.css" fail to load. The error status is 404 Not Found.
I think this is because I'm in a subdirectory of the root folder.
I've also tested running php bin/console server:run and testing it on 127.0.0.1:8000 but the results are the same. The css and js resources fail to load.
I'm comfortable editing Apache's .htaccess file. What am I missing? How do I either configure Apache or Symfony to find these resources?
The latest GitHub Repository fixed the error. The nightly build of the demo project did not have the assets. It now includes the missing css and js. The fix is mentioned in the commit.
The documentation of the symfony-demo is lacking information about the new build tools it is using. Check out the new api to build the frontend assets in Symfony based on Webpack Encore.
You can find more information in these issues Manage frontend dependencies properly and Manage application assets with the new Symfony asset manager.

Integrate React Js with Drupal-8

Is their a way to integrate Drupal-8 and React js.
I mean frontend be React js and backed be of Drupal-8.
I have gone through:
http://www.anexusit.com/blog/how-to-add-reactjs-drupal-8-composer
I have followed all the steps and done but dont know how can I use it.
Can any one please suggest some clear steps to me ..
also followed:
https://www.reddit.com/r/reactjs/comments/564gdy/react_frontend_for_your_drupal_8_backend/
In need of some clear suggestions.
Thanks in advance.
Found this article, but didn't get time to try it as I am a bit busy on another thing. Hope this will help you.
https://medium.com/#Userium/headless-drupal-build-a-drupal-8-api-with-a-reactjs-front-end-e43bf0fb94db#.2qn0u2im4
I'm currently building a module for Drupal 8 using ReactJS. I recommend you to see this: https://github.com/blackwood/drupal-react_blocks that's for Drupal 7 and then to Drupal 8 try to understand this portuguese steps: http://www.drupalbrasil.com.br/drupal-8-e-reactjs
Before starting just install libraries module to Drupal 8 and then install rest web services so after that you can copy and paste code from above to start learning how the integration works.
Using drush to install libraries and rest web services module:
drush dl libraries
drush en -y libraries
drush dl rest
drush en -y rest
I recommend you to use PHP 7 because I'm currently having troubles installing rest module for PHP 5.6.
I highly recommend you try this module (found in this repository: https://github.com/dtraft/react_quickstart ). Its built with react and can run in Drupal 8.
Add this folder in sites/all/modules/ or you can also create a subdirectory for modules you make in sites/all/modules/custom/ .
And then follow the instructions found below the repository's link or the read.md file.
Clear your site's cache in your site's Admin/Configuration/Performance/ then click Clear all cache. Save the configuration.
Then go to, Extend menu of your site search for "Decoupled Drupal with React Quickstart". Install it.
Lastly, go to Structure/Block Layout menu and add a block any part of you site and then you can choose from all existing blocks. Choose Clock Face Block.
Refresh your sites home page and there you have it!
If you want to integrate react and use inside, you can simply create a react app anywhere and when you finished just do a
npm run build
once you finished just copy the js and css file generated inside build/static folder :(js/main.something.js and css/main.something.css) to your drupal module or theme and then just reference theme in module_or_theme.libraries.yml

Cakephp 3.0 or > on Azure?

Is it possible to run Cake 3.0 or higher on Azure Web Apps? I have an app running locally on a 3+ version but when I installed CakePHP on my Azure web app it's running 2.5.1.
I feel like it's just a matter of uploading all of the newer files and the db created for the 3.0 version but scared there is some kind of write access the new cake will need thus preventing it from running and burning a ton of my time.
I started learning PHP 3 weeks ago so calling me a newb is probably an insult to newbs.
This article tells answered most of my original questions regarding this issue.
Yes, it is possible to deploy CakePHP > 3.0 applications to Azure Web Apps. But we need to some preactions to make the application to run. Generally, you can try to following steps:
Create an empty Azure Web Apps, and enable Composer extension, and also you can enable Visual Studio Online for easy script modifications and command running. Refer to https://azure.microsoft.com/en-us/documentation/articles/web-sites-php-mysql-deploy-use-git/#enable-composer-automation-with-the-composer-extension for more.
Create a file named web.config with the content at http://book.cakephp.org/3.0/en/installation.html#iis7-windows-hosts in the root directory of your application.
Add the inlt extension in PHP runtime on Azure. Add a folder named ext in your root directory, create a file ext.ini in this folder with the content:
extension=php_intl.dll. Add an App Setting to your Web App with the key PHP_INI_SCAN_DIR and value d:\home\site\wwwroot\ext. You also can do this step leverage Visual Studio Online extension after deployment. Refer to https://azure.microsoft.com/en-us/documentation/articles/web-sites-php-configure/ for details.
Set up the development environment of your Azure Web Apps, deploy your CakePHP application to Azure via Git. Refer to https://azure.microsoft.com/en-us/documentation/articles/web-sites-php-mysql-deploy-use-git/#set-up-the-development-environment for details.

How to create SEO Friendly Urls in Laravel

So excited as I have just started working on Laravel, After working nearly for an year with Plain PHP, I finally Started with a framework.
Friends can you please help me with some of my doubts,,,
I am using Ubuntu as Operating System.
I am using PhpStorm as IDE.
I downloaded Laravel Framework and integrated it in PhpStorm.
I successfully Localhosted laravel Welcome page as localhost/public/index.php
Have done this much so far.. But there is something remaining, the url should be friendly like( localhost/index or localhost/welcome ) but i have to type them fully as ( localhost/public/index.php ).
What is the problem? What am I lacking.
You should not have to use /public/index.php
You should setup your webserver (apache/nginx) to use your /public folder as a web root. A typical Laravel installation will take care of the rest if you're using Apache.
See the "Pretty URLs" section of the documentation: http://laravel.com/docs/5.1/installation

Categories