Google App Engine on PHPStorm 10 - google-app-engine

I have trouble running/debugging Google App Engine application from PHPStorm lately. It seems that PHPStorm adds a dot ( . ) at the end of the command when running dev_appserver.py
/usr/bin/python /Users/maksim/google-cloud-sdk/platform/google_appengine/dev_appserver.py app.yaml ember.yaml dispatch.yaml --php_executable_path=/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/php55/php-cgi --host=0.0.0.0 --enable_sendmail=true .
dev_appserver.py: error: unrecognized arguments: .
Process finished with exit code 2
When I run the command without dot from my terminal, it is working perfectly.
/usr/bin/python /Users/maksim/google-cloud-sdk/platform/google_appengine/dev_appserver.py app.yaml ember.yaml dispatch.yaml --php_executable_path=/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/php55/php-cgi --host=0.0.0.0 --enable_sendmail=true
How can I fix this? Can JetBrains team update the plugin for Google App Engine or is there a workaround to remove that dot from being added to the script?
EDIT: forgot to add Google App Engine SDK version which is release: "1.9.28"

I encountered a similar problem with PyCharm/python.
Creating a custom Run configuration for my project as suggested in this answer worked for me: Run App Engine development server with modules in PyCharm, a similar solution might work for PHPStorm.

Related

Intellij Keeps Telling Me "App Engine SDK path is not correct.'

Trying to deploy my first Google Cloud Java app using Intellij. I've followed and read so many threads and have gotten absolutely nowhere on what is seemingly one of the simplest steps of getting this set up. I have installed gcloud CLI and followed the instructions here. After installing, I run the commands 'gcloud components update' and 'gcloud components install app-engine-java'. I see the folder located in both 'C:\Users<username>\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine' and 'C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine'. I installed as multi user after hours of trying to get the single user install working, so now I have both. When in Intellij I am creating a new Google App Engine project under Java EE, it asks to specify a Google app engine SDK. There are no options so I choose to select the path. I have tried both above paths and it only tells me 'App Engine SDK path is not correct'. What am I doing wrong?? The steps seem ridiculously simple and it just doesn't work.
You stopped at the general google app engine folder
You need to specify the full path to the java-sdk folder, see the image in this question.

Stuck on "Get Started" page of Google App Engine. "gcloud app deploy" fails

I am stuck on the first page of instructions for Google App Engine
https://console.cloud.google.com/appengine/start/reception
I downloaded and installed the cloud SDK.
"gcloud init" worked.
I am stuck at "Deploy to App Engine".
When I type "gcloud app deploy" in Terminal, I get two errors.
"ERROR: An app.yaml (or appengine-web.xml) file is required to deploy this directory as an App Engine application. Create an app.yaml file using the directions at https://cloud.google.com/appengine/docs/flexible/python/configuring-your-app-with-app-yaml"
The page it says to go to does not give directions for creating the file. What is the command? Also, why is this error happening at all? If I follow the instructions on the Get Started page, I should not get an error. Some instructions must be missing or something not working when I install the SDK.
The second error I get is "ERROR: (gcloud.app.deploy) [/Users/chucky] could not be identified as a valid source directory or file."
Again, there must be instructions missing because I am following them.
Screen Shot
gcloud app deploy is for deploying a project. This means you need to have a folder with a sample project. The project will need to have an app.yaml file. Essentially, the steps are
Download and install the Google Cloud SDK
Run gcloud init to initialize the SDK (this makes you to login to Google and grant access to gcloud to your account; also sets up your default project)
Create your project (or copy an existing one) where project is your App i.e. the application you are working on. This project should have an app.yaml file.
Then deploy your project to production by running gcloud app deploy. You first have to change directory to your project folder. If you don't want to do this, you have to specify the full path to your app.yaml file.
An alternative for steps 3 - 4 is to use a Graphical User Interface (GUI) like one from us - https://nocommandline.com . You just click a button to create a new project and it will create a shell project ('hello world') with all the necessary files. To deploy your project, you also click another button 'Deploy' and it will take care of deploying your project.
From the link:
https://console.cloud.google.com/appengine/start/reception
First, you need to download the resources. You can use the Cloud SDK, Cloud Shell, directly download from github or other terminal to download the resources files. For example, you want to deploy a Python app using Cloud SDK in Windows OS:
Install and open Cloud SDK.
Copy the resources file from github:
From Cloud SDK run:
git clone https://github.com/GoogleCloudPlatform/python-docs-samples
Go to directory of your application files:
cd python-docs-samples/appengine/standard_python3/hello_world
Deploy and browse your application
Deploy using the command:
gcloud app deploy --project PROJECTID
Browse using the command:
gcloud app browse --project PROJECTID
If you see the Hello World! you've successfully deployed your application.

Deploy ASP.NET Core 2.1 app to Google Cloud App Engine error: bad character range

When I try to publish an ASP.NET Core 2.1 Web Application to Google Cloud Platform App Engine I get the error gcloud crashed (error): bad character range.
I publish with the GCP Visual Studio 2017 extension and I get the above error.
I publish from the cmd with an app.yaml in my project and I get the above error.
In order to deploy the ASP.NET Core 2.1 web application to Google Cloud App Engine I added an app.yaml file with the following contents:
runtime: aspnetcore
env: flex
I did the following:
Added app.yaml with
runtime: aspnetcore
env: flex
Added it to csproj
<ItemGroup>
<None Include="app.yaml" CopyToOutputDirectory="Always" />
</ItemGroup>
And executed the command
gcloud beta app deploy ./bin/release/netcoreapp2.1/publish/app.yaml
However I got the error: gcloud crashed (error): bad character range
Anyone know what I am doing wrong?
I follow the following guide and still get the same error when I try method 1, 2 and 3: https://cloudplatform.googleblog.com/2017/10/4-ways-you-can-deploy-an-ASP.NET-Core-app-to-GCP.html
This issue is being investigated at the moment and a fix should be released soon. As a workaround, please downgrade your Cloud SDK version to 212.0.0 by running the following command:
gcloud components update --version 212.0.0
Downgrading the version of your Cloud SDK to 212.0.0 or lower works because it seems in version 213.0.0 some changes were implemented that caused an issue with the yaml parser used by gcloud.
In addition, please follow this Issue Tracker thread to get updates regarding the status of this issue.
You should navigate to the publish directory first and deploy from there. Make sure the app.yaml file is present in the publish directory.
dotnet publish -c Release
cd ./bin/Release/netcoreapp2.1/publish
gcloud app deploy

GoogleAppEngine wordpress complains (Could not create directory) on update and plugin install

I have a problem updating wordpress or installing wordpress plugin in my local version of google app engine. I get the following message.
Downloading install package from
https://downloads.wordpress.org/plugin/event-espresso-decaf.4.8.38.decaf.zip…
Unpacking the package…
Could not create directory.
With the same code base I am able install plugin using MAMP (Macintosh, Apache, MySQL, and PHP). However fails with google Pyton script (dev_appserver.py).
I tried changing the permission of the file system by giving privilege to all user for write. Tried executing as sudo dev_appserver.py .. Followed the advice in other post, No luck.
Whats the problem here?, With MAMP all looks good in my local, but the same code break as I deploy to GAE (​appcfg.py -A APP-ID update app.yaml). Whats the problem here
Cannot write to file on Google App Engine Dev server with PHP?
Staring SDK 1.9.18, dev_appserver disables local file writing by default to better simulate the production environment. You can enable file writing by adding "google_app_engine.disable_readonly_filesystem=1" to your php.ini file.
I also wrote a blog post about running WordPress on App Engine flexible environment at:
https://wp.gaeflex.ninja/2016/03/25/using-wordpress-multisite/
Please give it a try too.

Laravel FatalErrorException on Google App Engine

I am deploying an laravel application in Google app engine. I have installed SDK and python. I can deploy it online, but when run application localy by using this command from cmd:
python dev_appserver.py --skip_sdk_update_check=yes --port=8080
--admin_port=8000 --php_executable_path=C:\wamp\bin\php\php5.4.12\php-cgi.exe C:\laravel-master
It shows the following error:
PHP Startup: apc_fcntl_create: could not open C:\Windows\.apc.a02796
I really need to run it locally because I can't test it online. Pls I need some help
This is the cache having problems to send write file commands to your Windows SO. A workaround to this is to locally disable APC by adding:
apc.enabled = "0"
Do your SDK php.ini file.
But it's better to keep it enabled in your GAE application.

Resources