ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Connecting to Databases in PHP

August 25, 2010 1:01pm

Subscribe [3]
  • #1 / Aug 25, 2010 1:01pm

    sourcedesign

    12 posts

    I have just upgraded to EE2 and I need to connect via PHP to an external MySQL database sitting on the same server as our main EE 2 database. This was something that was easy to undertake in EE 1.

    If I turn on PHP in the template and try and connect to the database I get the following error message:

    Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 27098 bytes) in /htdocs/XXXX/system/expressionengine/core/EE_Output.php on line 308

    I have upped the memory allowed in the system index.php and various other places with no effect.

    Has anybody connected to another database using EE 2 and could provide me with some examples? I cannot find help about this anywhere!

    Thank you in advance.

  • #2 / Aug 25, 2010 2:43pm

    Ingmar

    29245 posts

    For some reason PHP here needs more than 64 MB. Where, exactly, have you upped the memory?

  • #3 / Aug 26, 2010 5:36am

    sourcedesign

    12 posts

    I have updated it to added ini_set(‘memory_limit’, ‘256M’); to the index.php in the root of the installation and also ini_set(‘memory_limit’, ‘256M’); to the system index.php.

    I also tried adding the line to EE_Output.php file.

    I also setup a .htaccess file and added php_value memory_limit 256M to it.

    However none of these change the error message that I am getting, it still says it is exhausted after 67108864 bytes (64MB).

    Will it be looking for memory allocation elsewhere?

  • #4 / Aug 26, 2010 6:49am

    Sue Crocker

    26054 posts

    Check with your host.. they’ll have more information on how to upgrade the memory setting.

  • #5 / Aug 26, 2010 6:57am

    sourcedesign

    12 posts

    Check with your host.. they’ll have more information on how to upgrade the memory setting.

    I am the host 😉

    The site is sitting on our local server in my office I am are running Apple/MAMP.

    Any further suggests gratefully received, thank you in advance.

  • #6 / Aug 26, 2010 6:59am

    Sue Crocker

    26054 posts

    Here’s a link for Drupal that might prove helpful:

    http://drupal.org/node/207036

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases