Okay, I found their sample. It basically does a check on the global SERVER variable to determine if they are running locally and changes the connection string. So I got this out of it:
$isLocal = !isset($_SERVER['SERVER_SOFTWARE']) || strpos($_SERVER[ 'SERVER_SOFTWARE'], 'Google App Engine') === false; I guess I have to find out why my local PHP is not configured to properly for mysql. On Wednesday, November 4, 2015 at 3:00:51 PM UTC-8, Terence Ramos wrote: > > I'm completely new to GAE development. I'm just trying to connect to the > Cloud SQL instance I created for my App Engine PHP application. My php file > is a bare bones: > > <?php > > > // Using mysqli (connecting from App Engine) > > $sql = new mysqli( > null, // host > 'root', // username > '', // password > '', // database name > null, > '/cloudsql/my-app-id:my-sql-db' > ); > > My application does have permission to use the cloud sql instance. The > issue is this seems to work when deployed, but locally it doesn't. I get: > > Warning: mysqli::mysqli(): (HY000/2002): No such file or directory in / > Users/myuser/Work/projects/default/index.php on line 23 > indexaction > > The GAE PHP help files don't seem to help. They state something like, see > above for how to use GAE locally with the book sample. But the sample above > in the web site is the Hello, world! Does anyone know where I can find > information on this, or how to do this? > > Thanks > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/1c521ba5-b480-4e3b-80d7-460810cf60c1%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
