Wordpress and PHP5

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tinatina
Forum Newbie
Posts: 10
Joined: Thu Aug 30, 2007 12:06 am

Wordpress and PHP5

Post 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 :)
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

Are there any error messages? I'm afraid we really don't have enough to go on so far.
tinatina
Forum Newbie
Posts: 10
Joined: Thu Aug 30, 2007 12:06 am

Post 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
tinatina
Forum Newbie
Posts: 10
Joined: Thu Aug 30, 2007 12:06 am

Post 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? :/
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post 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 :-(
tinatina
Forum Newbie
Posts: 10
Joined: Thu Aug 30, 2007 12:06 am

Post 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.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post 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.
tinatina
Forum Newbie
Posts: 10
Joined: Thu Aug 30, 2007 12:06 am

Post by tinatina »

i hate wordpress :( i blame wordpress.
tinatina
Forum Newbie
Posts: 10
Joined: Thu Aug 30, 2007 12:06 am

Post by tinatina »

hmm okay i'll fart around with it a bit i guess :X
tinatina
Forum Newbie
Posts: 10
Joined: Thu Aug 30, 2007 12:06 am

Post 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 :/
Post Reply