0

I have a index.php with a

require 'myfolder/folder/lib1.php';

So in app.yaml I reference:

- url: /myfolder/folder/lib1.php
  script: myfolder/folder/lib1.php

but this lib1.php does another require 'lib2.php'; at same folder level /myfolder/folder/. So it trows error 500 because it can't find lib2.php. How can I properly reference them both in app.yaml?

Veilkrand
  • 315
  • 3
  • 16

3 Answers3

4

Your app.yaml file is for routing requests from incoming URLs to the initial script you want to use to process the request.

You don't need to add routings for each and every *.php file that you want to include from one script to another.

For example, look at the app.yaml example for running wordpress. It just has the URLs that clients will access, but not all of the php scripts used by wordpress.

Lipis
  • 19,958
  • 18
  • 88
  • 117
Stuart Langley
  • 7,004
  • 1
  • 18
  • 19
  • Ok, Im going a little clueless here... I'm trying to include the facebook API but it shows error 500 all the time. – Veilkrand May 21 '13 at 07:28
  • @Veilkrand: That is independent to `app.yaml`. Instead consider to use *composer*/*packagist* for PHP package management for an easy way. http://getcomposer.org - https://packagist.org/search/?q=facebook – hakre May 21 '13 at 10:54
1

The problem you face is most likely independent to Google App Engine. On Google App Engine, the standard rules of PHP file-inclusion still applies. The only potential difference here is that the files are read-only (but that should not pose any problems in your case).

So if lib1.php requires lib2.php you need to require the later before you require the other. That is standard PHP behavior:

require 'myfolder/folder/lib2.php'; 
require 'myfolder/folder/lib1.php';

To learn more what exactly caused the 500 error on Google App Engine, consider downloading the log and look into it. This is also independent to Google App Engine, because that is the best suggestion one can give with any webserver on 500 errors.

hakre
  • 178,314
  • 47
  • 389
  • 754
0

The error 500 was thrown basically because Google App Engine for php doesn't support CURL extension used in the Facebook php SDK. Nothing related to app.yaml includes. I forked the official fb sdk git and I'm patching a solution right now.

Veilkrand
  • 315
  • 3
  • 16