cancel
Showing results for 
Search instead for 
Did you mean: 

Not sure if PHP is working correctly

icehot
Newbie
Posts: 3
Registered: ‎17-01-2008

Not sure if PHP is working correctly

Hi there,
Just activated CGI, and mySQL on my plus net account yesterday, and I've tried uploading Wordpress to the site and going to the site in my browser but I always seem to get internal server errors.
The site is: http://ccgi.icehot.plus.com
Neither that works nor the install script: http://ccgi.icehot.plus.com/wp-admin/install.php
As far as I could tell plus net has the minimum requirements to run Wordpress, and I've changed the permissions of every file to 755 as well.
9 REPLIES 9
Colin
Grafter
Posts: 1,264
Registered: ‎04-04-2007

Re: Not sure if PHP is working correctly

Do you have a .htaccess file in your home directory (the directory you get when you SSH or FTP to the server)? You may need to set your FTP client to show hidden files to view it.
If you do, could you post the contents of it here, or PM me with them?
icehot
Newbie
Posts: 3
Registered: ‎17-01-2008

Re: Not sure if PHP is working correctly

Hi there,
Double checked that show hidden files was on, and I definately don't have a .htaccess file in there.
Colin
Grafter
Posts: 1,264
Registered: ‎04-04-2007

Re: Not sure if PHP is working correctly

Hmm, it looks like your PHP script is throwing an error... but I can't see what the error actually is though.
prichardson
Grafter
Posts: 1,503
Thanks: 1
Registered: ‎05-04-2007

Re: Not sure if PHP is working correctly

I'm not 100% convinced it is PHP throwing an error, as I am unsure it would throw a 500 internal server error the way it is.
What if you upload a simple PHP file named test.php as follows.

<?php
echo "test";
Ben_Brown
Grafter
Posts: 2,839
Registered: ‎13-06-2007

Re: Not sure if PHP is working correctly

I had a look at this the other day.
What it is is that the latest version of wordpress tries to log errors using the php "error_log" function, with the default setting for output. As we've not set up the "error_log" directive in the php config, this defaults to standard out.
There's a function run before any output to check for certain tables, and as they don't exist on a new install, it errors.
As we use cgiwrap on cgi for security, it sees these errors as headers, and as they aren't in the correct format for headers, it barfs, and gives the 500 server error.
To fix it, change line 163 of wp-includes/wp-db.php from:

error_log($error_str, 0);

to:

error_log($error_str . "\n", 3, '<your homedir>/wp-errors.log');

replacing <your homedir> with your homedir, e.g. /files/home1/username
Or alternitively comment out that line.
icehot
Newbie
Posts: 3
Registered: ‎17-01-2008

Re: Not sure if PHP is working correctly

Ahhh thanks very much - it's working great now!!!
jswags
Newbie
Posts: 2
Registered: ‎29-02-2008

Re: Not sure if PHP is working correctly

Hi,
I've got the same issue with Word Press Mulit User 1.3.3 (WPMU) version. It's throwing up a 500 Internal Server Error when I try to install WPMU.
I've looked for the same line of code within the wp-db.php but it's a different setup. I tried commenting the function print_error($str = '') but to no avail.
Has/Is anyone else having this issue, I'm pretty sure it's the same issue as Ben described above?
Thanks
Ben_Brown
Grafter
Posts: 2,839
Registered: ‎13-06-2007

Re: Not sure if PHP is working correctly

I just installed this on my CGI space, version 1.3.3 from the wordpress site, and it "just worked". Here's my comand history:

wget http://mu.wordpress.org/latest.tar.gz
tar xzf latest.tar.gz
cd wordpress-mu-1.3.3/
find . -type f -name "*.php" -exec chmod +x '{}' \;

I then browsed to where it was installed, and followed the instructions on the page, and the site seems to be fine.
jswags
Newbie
Posts: 2
Registered: ‎29-02-2008

Re: Not sure if PHP is working correctly

Thanks for the reply and Ben you're a lucky man cause after countless clean installs I'm still getting no luck. As a note I'm getting this error on install
install_blog - ID: 1 URL: http://myURL.com/wp/ Title: Test WordPress database error: [Unknown column 'blog_public' in 'field list'] UPDATE wp_blogs SET blog_public = '1', last_updated = NOW() WHERE blog_id = '1'
The root http://myURL.com/wp/ throws up a 404. I've been through .htaccess with a fine tooth comb, write permissions, ftp'd and command line upload as you did.
The one thing that is displaying is the login, but it's lost all of the css so I'm thinking the .htaccess still isnt correct. If you can think of anything else let me know.
Thanks again
Jason
PS .htaccess
RewriteEngine On
RewriteBase /wp/
#uploaded files
RewriteRule ^(.*/)?files/$ /index.php
RewriteRule ^(.*/)?files/(.*) /wp-content/blogs.php?file=$2
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . -
RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2
RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2
RewriteRule . index.php