Page 1 of 1

Wordpress and PHP5

Posted: Thu Aug 30, 2007 12:20 am
by tinatina
I'm a tiny bit new at this so please forgive me :) I've also never asked for help on coding so I don't know what's important or not.

So I did try searching google for this, and I guess other people's problems that I found was that they couldn't log into wordpress. So yea. I actually haven't tried to login yet.

My server currently went from using php 4.2 to 5 and a few of the things weren't working, like mime_content_type. So I emailed the company and they fixed all that, and then i noticed that one of the includes weren't working. It was specifically a url include that had been disabled on my server, and though there is a way to enable it using the .htaccess file, it just gives me an internal error whenever i do so. I might contact the company about that but i imagine I shouldn't have to use url includes anyway.

This is a bit jumbled. Because of the way my site is arranged, it's been a buildup of stuff for the past 4 years. And I keep looking for blogging scripts and cutenews would always screw up on me for no reason. So I started using wordpress but instead of trying to convert everything into wordpress, i made a wordpress directory and just included the index. So this is where the include doesn't work. With php 4.2 it works fine, but whenever i include the index using php5, it can't include a file that the index.php in the wordpress directory requires, and i don't know why. So I fix it but it only displays one post. And it's all kept in SQL if that's important at all.

However, when I go back to php 4.2, the /home/ way thingy doesn't work anymore. It says it cant find the file. So i put it back to a url include and still have to edit one line in the wordpress index.php, but it works fine :( But I would really like to get everything working in php5 before the end of the year because im stubborn like that.

So i dont know if anyone can help me with this or what kind of code they'd have to see, but if anyone has any suggestions that'd be cool. Thanks :)

Posted: Thu Aug 30, 2007 12:42 am
by Kieran Huggins
Are there any error messages? I'm afraid we really don't have enough to go on so far.

Posted: Thu Aug 30, 2007 12:45 am
by tinatina
yes. when using a url include, it says

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/peacher/public_html/index.php on line 126

Warning: include(http://peachers.net/wordpress/index.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/peacher/public_html/index.php on line 126

Warning: include() [function.include]: Failed opening 'http://peachers.net/wordpress/index.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/peacher/public_html/index.php on line 126

when using /home/public_html/ etc etc... it says

Warning: require(./wp-blog-header.php) [function.require]: failed to open stream: No such file or directory in /home/peacher/public_html/wordpress/index.php on line 4

Fatal error: require() [function.require]: Failed opening required './wp-blog-header.php' (include_path='.:/usr/local/php5/lib/php') in /home/peacher/public_html/wordpress/index.php on line 4

Posted: Thu Aug 30, 2007 12:48 am
by tinatina
oh yea but the url include works in php4 but not the home/public_html one for some reason. I'm using other includes that way though so I don't get it. How it says it can't find a suitable wrapper, does that make it my companies problem? Did they forget something? :/

Posted: Thu Aug 30, 2007 1:04 am
by Kieran Huggins
if it's a local file you should include it with:

Code: Select all

include($_SERVER['DOCUMENT_ROOT'].'/wordpress/index.php')
PHP is complaining about retrieving the file in a remote manner. It's a security thing.

Damn - I missed the 888th visitor present :-(

Posted: Thu Aug 30, 2007 1:08 am
by tinatina
well it's still giving me the second error where it says it cant find wp-blog-header.php.

This is the error
Warning: require(./wp-blog-header.php) [function.require]: failed to open stream: No such file or directory in /home/peacher/public_html/wordpress/index.php on line 4

Fatal error: require() [function.require]: Failed opening required './wp-blog-header.php' (include_path='.:/usr/local/php5/lib/php') in /home/peacher/public_html/wordpress/index.php on line 4

And this is the code that wordpress uses

/* Short and sweet */
define('WP_USE_THEMES', true);
require('./wp-blog-header.php');

and when i take out the ./ then it only includes one single post instead of the 5 that i wanted.

Posted: Thu Aug 30, 2007 1:14 am
by Kieran Huggins
instead, try:

Code: Select all

require($_SERVER['DOCUMENT_ROOT'].'/wordpress/wp-blog-header.php')
If you're only getting one post (but you ARE getting one post) I'd bet it has something to do with either Wordpress settings or your template.

Posted: Thu Aug 30, 2007 1:14 am
by tinatina
i hate wordpress :( i blame wordpress.

Posted: Thu Aug 30, 2007 1:15 am
by tinatina
hmm okay i'll fart around with it a bit i guess :X

Posted: Thu Aug 30, 2007 1:23 am
by tinatina
nope this is way weird. i dont even know whats going on anymore.
I messed with the options and it did nothing. And then it only shows one post. and each time i make a new post, it doesnt show it. but when i use http://www.peachers.net/wordpress/index.php, it's all 100% fine. So it's weirding me out :/