can't get random block to work on new server. help.

mgoyal

Joined: 2007-01-23
Posts: 7
Posted: Tue, 2007-01-23 05:34

Hi,
I've been using random block (actually, "block-random-enhanced.php") for a couple of years now.

I recently copied my website (Wordpress 2.1 and Gallery 1.55pl1) over a to a new server. The DNS is pointing to the new server and almost everything is working fine.

The only issue I'm having is with block-random.php and block-random-enhanced.php.

Other PHP files using my gallery run fine, such as "topXalbums.php" at http://www.snagabag.com/gallery/topXalbums.php

However, both http://www.snagabag.com/gallery/block-random.php and http://www.snagabag.com/gallery/block-random-enhanced won't run.

block-random.php gives me the following error:
Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 12 bytes) in /home/snagab00/domains/snagabag.com/public_html/gallery/classes/Album.php on line 924

and block-random-enhanced.php is presented as a download by my browser instead of being executed. however, when I try to run it from my blog I get the following error:
Warning: main(http://www.snagabag.com/gallery/block-random-enhanced.php) [function.main]: failed to open stream: HTTP request failed! in /home/snagab00/domains/snagabag.com/public_html/blog/wp-content/themes/Carrots/index.php on line 270

You can see it working here:
http://209.51.150.53/~snagabag/blog/

And not working here:
www.snagabag.com/blog/

I'm looking for any help on how to get it to run on my new server.

Thanks!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2007-01-23 05:48
 
m_aman

Joined: 2007-01-22
Posts: 1
Posted: Tue, 2007-01-23 07:41

grt info florid

 
mgoyal

Joined: 2007-01-23
Posts: 7
Posted: Wed, 2007-01-24 06:49

Thanks for the info! Very helpful. I'm a PHP/programming novice, but I did some investigation.

My old server (where block-random.php works) returned the following from "ulimit -a":

core file size        (blocks, -c) 0
data seg size         (kbytes, -d) unlimited
file size             (blocks, -f) unlimited
max locked memory     (kbytes, -l) unlimited
max memory size       (kbytes, -m) unlimited
open files                    (-n) 16384
pipe size          (512 bytes, -p) 8
stack size            (kbytes, -s) unlimited
cpu time             (seconds, -t) unlimited
max user processes            (-u) 7168
virtual memory        (kbytes, -v) unlimited

My new server, where block-random isn't work, returned the following:

core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
pending signals                 (-i) 1024
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 16384
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 16127
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

In addition to have some additional parameters, the new server has a limit on "max locked memory" and "stack size" both of which are 'unlimited' on the original server.

Can I change these (max locked memory and/or stack size) via .htaccess or inserting a little php into my main.php file? Is it safe to try? I'm on a shared server and don't want to screw anything up.

Thanks!

 
mgoyal

Joined: 2007-01-23
Posts: 7
Posted: Wed, 2007-01-24 07:18

Also, what does it mean that a specific PHP file is being presented as a download by my browser? (ie-FireFox is asking if I want to open or save the PHP file.)

On my new server, other PHP files run just fine:
http://www.snagabag.com/gallery/topXalbums.php

but the random photo PHP file is presented as a file to download:
http://snagabag/gallery/block-random-enhanced.php

even though the same file is executed properly in my browser on my old server:
http://209.51.150.53/~snagabag/gallery/block-random-enhanced.php

I've checked the permissions for these PHP files and they are set to 644 on both my old and new servers.

(apologies in advance if my questions are asinine...I'm not well versed in these matters.)

 
mgoyal

Joined: 2007-01-23
Posts: 7
Posted: Sun, 2007-01-28 04:47

Updated info...

1. I did not perform a fresh install of Gallery on my new server. Rather I copied my Gallery install over from the old server and reran the config script. Everything appears to be fine (except for the block-random) with Gallery on the new server.

2. Got the following info from my webhost:
"Memory limit is set to 32 megs on www11 and they're (now) set to 50 megs on the new server, yet it's not working on the new server, there's something that needs adjusting on the script not sure what, but 50 megs is more than I really like to set for a memory limit (it was set to 40 which is more sensible).
Maybe see if the authors can shed some light on why it would use way way more memory on one server than another."

3. Used the info in the codex referenced above to increase the PHP memory limit but still getting the same error:
"Fatal error: Allowed memory size of 52428800 bytes exhausted (tried to allocate 40 bytes) in /home/snagab00/domains/snagabag.com/public_html/gallery/classes/Album.php on line 924"
The "Allowed memory size" increases to match the increased PHP memory limit. I increased it to 64megs with no luck. (The above quote is from a 50meg limit set.) Again, the memory limit on the old server (where it still works) is 32megs.

ANY help is appreciated.

Thanks.

 
mgoyal

Joined: 2007-01-23
Posts: 7
Posted: Sun, 2007-01-28 05:01

ok...found out my new server might have the following issue.
"the newer servers has restricted the ability to open http requests with SSI or PHP because there a security issue and can cause infinate loops."
waiting for confirmation from my webhost.