Author Topic: Any PHP experts in the house?  (Read 1193 times)

0 Members and 1 Guest are viewing this topic.

Offline Glenn Stauffer

  • SOHC/4 #3 - Member since 1994
  • Administrator
  • Expert
  • *****
  • Posts: 1,295
    • The SOHC/4 Owners Group
Any PHP experts in the house?
« on: May 14, 2014, 04:57:24 AM »
I learned from Steve Dennis, a member here (SteveD CB500F) who runs the UK SOHC site that the site is experiencing some issues after moving to a new host.

These are the two issues as he described them in an email to me:

  • When starting a new topic, the page is posted but the user gets the "white-screen-of-death"
  • When sending a PM, the PM is sent but the user gets the "white-screen-of-death"

The software he uses, which is the same used here, is Simple Machines Forum.

I'm not a php guru, but suggested that there might be memory issues either on the server itself or in the php configuration.

Anyone available to lend a hand?

Offline Glenn Stauffer

  • SOHC/4 #3 - Member since 1994
  • Administrator
  • Expert
  • *****
  • Posts: 1,295
    • The SOHC/4 Owners Group
Re: Any PHP experts in the house?
« Reply #1 on: May 14, 2014, 06:19:41 AM »
I did some digging to see if I could help and since I figured it would be good to know how to track down these errors myself - modification installation and removal on this forum software is frequently error prone. 

I discovered that php has a syntax checking mode, php -l <filename>.  Then I found, on stackoverflow, a small snippet of code that will execute this check against all the php files in a directory.  Here it is in case anyone else finds it useful.

<?php
for($i=1; $i < count($argv); $i++){
        $temp = "php -l " . $argv[$i];
        $output = exec($temp);
        echo "\n$output";
}
?>

I passed this along to Steve.  No word yet whether it was of any help.

Offline FuZZie

  • Expert
  • ****
  • Posts: 1,222
  • If I is expert, I can has cheezburger?
Re: Any PHP experts in the house?
« Reply #2 on: May 14, 2014, 11:03:53 AM »
I start with a check for BOM but it's a guess with out access to the files, I normally do phpbb3.
PM me if you need a hand I don't mind putting something back to this community great place and good people.  :)   

Offline MCRider

  • Such is the life of a
  • Really Old Timer ...
  • *******
  • Posts: 14,376
  • Today's Lesson: One good turn deserves another.
Re: Any PHP experts in the house?
« Reply #3 on: May 14, 2014, 01:12:36 PM »
Huh?   ???
Ride Safe:
Ron
1988 NT650 HawkGT;  1978 CB400 Hawk;  1975 CB750F -Free Bird; 1968 CB77 Super Hawk -Ticker;  Phaedrus 1972 CB750K2- Build Thread
"Sometimes the light's all shining on me, other times I can barely see, lately it appears to me, what a long, strange trip its been."

Offline Terry in Australia

  • Really Old Timer ...
  • *******
  • Posts: 33,403
  • So, what do ya wanna talk about today?
Re: Any PHP experts in the house?
« Reply #4 on: May 15, 2014, 03:03:59 AM »
Isn't PHP "Angel Dust"? ;D
I was feeling sorry for myself because I couldn't afford new bike boots, until I met a man with no legs.

So I said, "Hey mate, you haven't got any bike boots you don't need, do you?"

"Crazy is a very misunderstood term, it's a fine line that some of us can lean over and still keep our balance" (thanks RB550Four)

Offline MoMo

  • Really Old Timer ...
  • *******
  • Posts: 8,271
  • Ride like you're invisible
Re: Any PHP experts in the house?
« Reply #5 on: May 15, 2014, 03:21:36 AM »
Isn't PHP "Angel Dust"? ;D

You bet, and it is one of my least fond memories of the 70's.  Why I ever tried it is not explainable .  Sorry for stupid thread hijack Glenn

Offline MoMo

  • Really Old Timer ...
  • *******
  • Posts: 8,271
  • Ride like you're invisible
Re: Any PHP experts in the house?
« Reply #6 on: May 15, 2014, 04:51:06 AM »
That's PCP, Hippie!

right, what memory is left? ::)

Offline FuZZie

  • Expert
  • ****
  • Posts: 1,222
  • If I is expert, I can has cheezburger?
Re: Any PHP experts in the house?
« Reply #7 on: May 15, 2014, 06:01:15 AM »
Thinking some more on this Glen. A suppressed error message would be the second thing I'd look for (like it can't display the error and just hangs).
In phpbb3 you can enable it in the config file I don't know if SM has the same setup?
Make sure all error reporting is on for the server too, you may trap a clue in the logs.

EDIT:
Also where I'm just rereading your original post and it's happening on a move to a new host, look for version incompatibilities with php on the host. 
« Last Edit: May 15, 2014, 06:09:09 AM by FuZZie »

Offline Glenn Stauffer

  • SOHC/4 #3 - Member since 1994
  • Administrator
  • Expert
  • *****
  • Posts: 1,295
    • The SOHC/4 Owners Group
Re: Any PHP experts in the house?
« Reply #8 on: May 15, 2014, 06:52:17 AM »
Thanks for the thoughts.  Maybe you could send Steve Dennis (SteveD CB500F) a PM to see if you can lend a hand.  I sent him email, but haven't had a reply.
« Last Edit: May 15, 2014, 06:55:30 AM by Glenn Stauffer »

Offline FuZZie

  • Expert
  • ****
  • Posts: 1,222
  • If I is expert, I can has cheezburger?
Re: Any PHP experts in the house?
« Reply #9 on: May 15, 2014, 06:58:38 AM »
Quote
   
When starting a new topic, the page is posted but the user gets the "white-screen-of-death"
When sending a PM, the PM is sent but the user gets the "white-screen-of-death"

You need to see the server log and make sure the phpbb error is on in config, he can forget the memory thing it would be more that just 2 errors all of the post functions would be failing in that case. ;)

Offline FuZZie

  • Expert
  • ****
  • Posts: 1,222
  • If I is expert, I can has cheezburger?
Re: Any PHP experts in the house?
« Reply #10 on: May 15, 2014, 07:11:52 AM »
In the server log you'll be looking for a fail on/or after "get post" it will be repeated and the fails can be daisy chained in that case you want the first error reported as it will cause what follows.

Offline SteveD CB500F

  • Global Moderator
  • Old Timer
  • *****
  • Posts: 4,553
  • Ride on the Steel Breeze...
    • TVAM
Re: Any PHP experts in the house?
« Reply #11 on: May 21, 2014, 10:12:21 AM »
The SMF support guys (they have a forum too!) suggested a clean install of the forum files (NOT the database) so tried that on a sandbox and it worked.

Applied it to the live site on www.sohc.co.uk this afternoon and now all fixed.

My main concern was not to corrupt the database and hence all the members/avatars/attachments/posts/gallery pictures etc.

Steve
SOHC4 Member #2393
2015 Tiger 800 XRT
1971 CB500K0 (US Model)

Offline SteveD CB500F

  • Global Moderator
  • Old Timer
  • *****
  • Posts: 4,553
  • Ride on the Steel Breeze...
    • TVAM
Re: Any PHP experts in the house?
« Reply #12 on: May 21, 2014, 10:14:12 AM »
Next question.

Any WordPress experts in the house?

Not kidding. I've done quite a few WordPress sites but struggle with seemingly random white-screen-of-death and don't understand enough of PHP to fault find with the provided error messages from the debug module.

Steve
SOHC4 Member #2393
2015 Tiger 800 XRT
1971 CB500K0 (US Model)

Offline FuZZie

  • Expert
  • ****
  • Posts: 1,222
  • If I is expert, I can has cheezburger?
Re: Any PHP experts in the house?
« Reply #13 on: May 24, 2014, 04:38:38 AM »
What are you using to upload the files and edit? Two different software packs and the same error?

IMPORTANT SETTINGS:

Editing
1. only use UTF-8 character encoding (make sure your saving your files in this format consider it web code compliant and use it for everything).
2. make sure your saving no bom  (byte-order mark, commonly used in text editors BUT not code compatible).
3. this also applies to file compare programs!

Uploading
Make sure your uploading with the right settings ftp and server must match, I've tried more ftp programs that you can find! Auto select can cause issues with some of them. Google filezilla get it, try it, learn it, use it. Fully works and great price!

also same fix for wordpress should work and may well be much faster than finding the error.

PM me for an email and I'll check your debug messages. 

 
« Last Edit: May 24, 2014, 04:42:58 AM by FuZZie »