php code not working - php.ini settings?

A developer put together an image gallery that uses rss feeds to load image content for a client of mine. The code works fine on the developers server and my server. It is not working on the clients server. I assume it has something to do with either the php.ini file setting, or some other server settings since the code works fine on two other servers.

My server is running PHP Version 5.2.17 - Linux linhost123.prod.mesa1.secureserver.net 2.6.18-238.19.1.el5PAE #1 SMP Fri Jul 15 08:15:44 EDT 2011 i686

The clients server is running PHP Version 5.3.8 - Linux vux113 3.2.1-gentoo #1 SMP Tue Jan 17 07:30:40 EST 2012 x86_64

The following code gets the rss feed from the url bar and feeds it to the php page below.

[php]<?php

if(isset($_GET[‘gallery’]))
{

$feedUrl= $_GET[‘gallery’];
}

?>[/php]

The following parses the rss feed.

[php]

<?php error_reporting(0); ///function toi test If IE is being used function ae_detect_ie() { if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) return true; else return false; } $rss = simplexml_load_file( $feedUrl); $title = $rss->channel->title; echo '

'.$title.'

'; $regx = "";

$matches = array();
foreach( $rss->channel->item as $img ) {
preg_match( $regx, $img->description, $matches);

$imageZen = str_replace("img src=","",$matches[ 0 ]);

$imageSize =
$replacement="";
$final = substr($imageZen, 0, -1).$replacement;
}

// the loop that displays the image tags from the feed
foreach( $rss->channel->item as $img ) {
preg_match( $regx, $img->description, $matches );

$imageZen = str_replace("img src=","",$matches[ 0 ]);
$replacement="";
$final = substr($imageZen, 0, -1).$replacement;
//change image sizes
$finalEdit = str_replace('-3','-4', $final);
$finalEdit_small = str_replace('-3','-11', $final);

//secho ‘<img src=’.$finalEdit_small.‘width="" height="" />’;
// echo ‘

  • ’;

    //ANd Finally we echo out the results

    if (ae_detect_ie())
    {
    echo ‘

    ’;

    }
    else
    {
    echo ‘

    ’;

    }

    }

    ?>[/php]

    Any help is appreciated.

    Is there something specific that’s not working or does it return just a white page?

    It just returns a blank page.

    http://www.markjasonphotography.com/testing/portfolio_new2.php?gallery=http://markjasonphotography.zenfolio.com/p287587201/recent.rss

    The html is rendered, but the thumbnails from the rss feed aren’t loaded. It doesn’t seem as if the rss feed isn’t being parsed.

    Again this code works on two other servers, but not the clients. As I mentioned the php version is newer on the client’s server. Not sure if this makes a difference. If been researching the problem, and have read that 5.3 deprecated a lot of code.

    Thanks for any help.

    Here’s the php.ini code. The file is actually names “php.coalesced.ini” which I’ve never seen before.

    ;
    ; Including file: /data/templates/web/user/domain.com/cgi-bin/php.default.ini
    ;

    upload_tmp_dir = /data/tmp
    asp_tags = On
    register_globals = On
    safe_mode = Off
    upload_max_filesize = 25M
    post_max_size = 25M
    output_buffering = 1024
    mime_magic.magicfile = /usr/share/misc/file/magic.mime
    memory_limit = 32M
    include_path = .:/usr/services/vux/lib/php
    disable_functions = shell_exec,passthru,exec,system,pcntl_exec
    allow_url_include = 0
    allow_url_fopen = 0
    extension_dir = /usr/services/vux/php5/lib/php/extensions
    zend_extension = /usr/services/vux/php5/lib/php/extensions/ioncube_loader_lin_5.2_real.so
    zend_extension = /usr/services/vux/php5/lib/php/extensions/ZendOptimizer_real.so

    realpath_cache_size = 64K
    realpath_cache_ttl = 600

    ;
    ; Suhosin Configuration
    ;

    ; Disable suhosin for now
    ;extension = suhosin.so
    ;suhosin.simulation = On
    ;suhosin.executor.disable_eval = On
    ;suhosin.executor.eval.blacklist = popen

    session.gc_probability = 1
    session.gc_divisor = 100
    session.gc_maxlifetime = 3600

    date.timezone = America/New_York

    error_reporting = (E_ALL & ~E_WARNING & ~E_DEPRECATED & ~E_NOTICE)

    ;
    ; User-based Defaults
    ;

    session.save_path=/data/23/2/64/151/2227966/user/2448153/cgi-bin/.php/sessions

    ;
    ; Including file: /data/templates/web/user/domain.com/cgi-bin/php.override.ini
    ;

    error_reporting = (E_ALL & ~E_WARNING & ~E_DEPRECATED & ~E_NOTICE)

    Solved. The “allow_url_fopen” php.ini setting needed to be changed to “1”.

    Sponsor our Newsletter | Privacy Policy | Terms of Service