Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to migrate my wordpress from a subfolde to the root. I've already done it from localhost to the subfolder with the same method

update_option('siteurl','http://example.com/blog');
update_option('home','http://example.com/blog');

But this time it does not look to work... It says "Call to undefined function phpupdate_option() in functions.php line 1.

In config.php there is no url define().

Is there someone who had a solution for it?

Thanks in advance.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

It sounds like your opening <?php tag is abutting your first call to update_option. If it isn't directly adjacent to it, perhaps the whitespace between the two is unrecognized for one reason or another (this can happen from copying and pasting from some sources). Have your functions.php file start off like this:

<?php

update_option('siteurl','http://example.com/blog');
update_option('home','http://example.com/blog');
share|improve this answer
    
yes, I put some space between <?php and the function. I mean... is it a white space problem? –  Tyler Durden Oct 1 '12 at 13:46
    
If I take it out, all the other functions work, then no matter how many whit line I put, it's always telling me "line 1" even if it's in line 3 or 4 or 100... –  Tyler Durden Oct 1 '12 at 13:56
1  
Try this: between the <?php and update_option, put a couple of newlines and a comment. Something like, /* this is a comment */. I suspect it's your code editor; maybe it's adding CR (mac) newlines, and PHP isn't parsing them. The comment should break it up no matter what. Add a space after <?php too, it won't hurt. We're going fishing with grenades ;-) –  Matthew Boynes Oct 1 '12 at 14:34
    
I fixed it, I just put one space with the spacebar and it works, apparently he didn't like the enter... –  Tyler Durden Oct 1 '12 at 16:23

You can change it from database also. In database there is wp_options table and these two fields present in this table.

share|improve this answer
    
Yes, I could, but this problem just came out and I want to understand why first. –  Tyler Durden Oct 1 '12 at 13:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.