0
votes

I have set up Google App Engine on my linux server. So when I run App Engine, and my app, it is accessible via: http://website.com:8080

In the "homepage" of the app, I have some simple PHP syntax saying:

require "config.php";

In config.php, I have my MySQL connection code:

<?php
    DEFINE ('DB_USER', 'mysqlusername');
    DEFINE ('DB_PASSWORD', 'mysqlpassword');
    DEFINE ('DB_HOST', 'mysqlserver');
    DEFINE ('DB_NAME', 'database');

    $dbc = @mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME)
    OR die('Cound not connect to MYSQL' .
        mysqli_connect_error());

    session_start();
?>

For some reason when I start the App, I have a completely blank page, and in the log of my server, it says:

ERROR:root:php failure (255) with: stdout: X-Powered-By: PHP/5.4.25 Content-type: text/html

stderr:

INFO 2014-12-12 22:50:04,909 module.py:718] default: "GET / HTTP/1.1" 500 -

1

1 Answers

0
votes

There are two problems: you're running App Engine devserver on a Linux server and calling it App Engine, and you're attempting to establish port connections (MySQL traditionally chooses 3606) on anything but 80 or 443, which are the only allowed ports. App Engine architecture (where your code is deployed) does not support this at present and you should look into CloudSQL.

To model the various restrictions and properties in the deployment environment VM sandbox that an App Engine instance lives in, App Engine devserver also does not allow connections on ports other than 80 or 443. I hope this has cleared up some confusions for you and that you will look into how to actually deploy your app on app engine architecture. Feel free to run any code you like on your (V?)PS, but App Engine is not just devserver and you should really consider using it correctly to get the most out of it. Devserver is not made for production.