GAE PDO not support sqlsrv - sql-server

I use Laravel with Sql Server in GAE, but I get error "could not find driver",
so I echo phpinfo in my site, and I found GAE PDO not support sqlsrv also not support pdo_sqlsrv.....
Is anyway I can fix that?
※I test my local environment is work, only GAE have this problem!

As mentioned in the The PHP Runtime documentation of the App Engine Flex, you can enable an extension by adding a php.ini to the root of your app before deploying it.
For installing drivers you will need to extend the runtime by creating a custom one, based on the basic PHP runtime available for App Engine. This will generate a Dockerfile in which you can add the necessary steps to install what you need.
This only works for App Engine Flex however, as you will need to deploy the Custom Runtime with the Dockerfile at the root of your app's folder.

Related

GAE: No longer able to update my Gaelyk project due to appcfg losing support

Recently tried to update my Gaelyk project (yes, it's old, but it works well and I still use it), but Google App Engine will no longer accept the update. The error message returned is "Deployments using appcfg are no longer supported. See https://cloud.google.com/appengine/docs/deprecations". The thing is, I never used appcfg to deploy my application; I used Gaelyk and Gradle. But obviously Gaelyk must have used appcfg under the covers.
I did download the replacement Google Cloud SDK, but this new tool is not similar at all to how Gaelyk and Gradle worked. Is there anything I can do to get Gaelyk to work anymore? Or is Gaelyk just dead and I need to rewrite my application (like in Node.js or something instead of Groovy).
This will be hard, however I will try to help you as possible. I think you may try to migrate it somehow to app.yaml configuration of GAE.
I am not sure what plugins are used in the project. From Gaelyk temple project I can see that it's using appengine-geb which, according to the documentation, behind the scenes, is using gradle-appengine-plugin (there is wrong link on this doc, but proper is bellow).
On the github of gradle-appengine-plugin I have found following.
There is a note:
NOTE: All App Engine users are encouraged to transition to the new
gradle plugin for their projects.
And in FAQ part there is following information:
How do I deploy with gcloud?
If you're using gcloud to deploy your application, the newest version of app deploy > doesn't support war
directories, you will need to provide it with an app.yaml OR you can
use the appengineStage task to create a directory that is deployable
in /build/staged-app
$ ./gradlew appengineStage
$ gcloud app deploy build/staged-app/app.yaml --project [app id]
--version [some version]
NOTES:
You must explicitly define all config files your want to upload
(cron.yaml, etc)
This does not work with EAR formatted projects.
I think the best option will be to migrate to new appenine plugin or if not possible try to implement is with gcloud app deploy command crating the config files manually (at least app.yaml). And for this migration I can provide you this document.
I hope you will manage somehow...
I can confirm that Serge's answer on the Gaelyk Groups site works; the same procedure that he figured out also worked for me. To summarize:
Run gradlew appengineRun as run previously with Gaelyk.
Copy all jar files inside the build\exploded-app\WEB-INF\lib folder into a \src\main\webapp\web-inf\lib folder (for me the new lib folder did not exist previously).
To deploy, use the new required gcloud tool, and instead of running gradlew appengineUpdate (which fails now), instead run
gcloud app deploy appengine-web.xml where that XML file can be found in your webapp/WEB-INF directory. I navigated to that directory to run the gcloud command, but you can use a relative path there if your working directory is elsewhere. (There are a number of optional flags associated with the gcloud app deploy command, but I didn't need any of them.)
Serge needed to use these instructions to convert datastore-indexes.xml to index.yaml and run gcloud app deploy index.yaml, however, I didn't need to do this because I had no datastores.

Does my PHP project need appengine-web.xml

Setting up IntelliJ IDEA to run my PHP Wordpress (for App Engine) projects. Google Cloud Tools installed.
Have imported existing project files and then went to Tools > Google Cloud Tools > Run on a local App Engine Standard dev server.
An error is returned:
Project does not contain App Engine Standard modules: To use the App Engine Standard local development server, the project must contain at least one App Engine Standard module with an appengine-web.xml configuration file.
I read up on appengine-web.xml and apparently its used for Java projects. I'm trying to run PHP at the moment.
I haven't dealt with this file type before, is it similar to app.yaml?
Do I need this fie to set up my local server for PHP?
Actually the file appengine-web.xml corresponds to the App Engine Java runtime, you don't need to use it in your PHP project. It is similar to the app.yaml in the sense that it is where you define your default service.
In order to define the default service in your PHP app, you need the app.yaml. There are also optional configuration files, such as:
dispatch.yaml, queue.yaml, index.yaml, cron.yaml, dos.yaml
On a side note, maybe PHP Storm or Eclipse with the PHP Development tools are more suitable for your use case.

PhpStorm / Google AppEngine with PHP7

I recently deployed my app using Google App Engine. I installed Google Cloud SDK and I'm using PhpStorm.
When I run my app using runtime : php55, it works. But I need PHP 7!
When I try with
runtime: php
env: flex
A error occured : flex, only the following runtimes are allowed: ('python-compat', 'java', 'java7', 'go', 'custom')
Do you have an idea?
Here is my app.yaml config:
Here is my composer.json config:
Here is my PhpStorm config:
As answered in the comments to the question, I see you are working with the Development Server, which does not support the Flexible Environment. The Development Server only supports the runtime environments available for App Engine Standard, which are Java 7 (now deprecated) and 8, Go 1.6, Python 2.7 and PHP 5.5.
However, it also supports custom environments, which allows you to work in any programming language just by supplying a base Dockerfile image that configures the runtime environment (in your case you can build yourself an appropriate image with a PHP 7 environment or download it from an existent repository). It requires of course some more complex configuration and management than that of the provided Development Server, but right now, that is the only way you will be able to work with PHP in the development for App Engine.
So the configuration of your application should be correct, it is just that the Development Server does not yet support the Flexible Environment that you need to develop in PHP 7.

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.

How to solve the jpa error?

i created one web application for accessing google bigtable.
but i shows the following error how to solve this
Description Resource Path Location Type
Your Web Application Project must be configured to use a JDK in order to use JSPs. guestbook.jsp /cftljpa/war Unknown Google App Engine Problem
how to solve this
Both the local App Engine server and the deployment process need to run javac in order to compile your JSPs. If your project isn't set to use a JDK ("Java Development Kit", which includes javac), then the JSPs can't be compiled.
Go to Preferences > Java > Installed JREs and make sure that you have a JDK installed -- if you don't, you can easily download one. Now right-click on your project and choose Properties > Java Build Path > Libraries and make sure that your project is using this JDK

Resources