By EJuhl on
First post, first Drupal installation, so bear with me if I sound stupid.
In setting up a new account, my web host misspelled the desired domain name. I needed to get going, so I set up Drupal anyway and began developing. All well.
So then the web host purchased the corrected domain name and pointed the new DNS registry to the site. They coincidentally decided to move the files to a different server. Not sure if that matters.
Now, for example when when I clear caches, I get a warning:
warning: realpath() [function.realpath]: open_basedir restriction in effect. File(/home/www/old-and-wrong-domain-name.com/tmp) is not within the allowed path(s): (/home/www/correct-domain-name.com:/usr/share/php:/home/www/default:/tmp:/usr/share/apache2/error/include) in /home/www/correct-domain-name.com/www/includes/file.inc on line 190.
There is an .htaccess file in the correct-domain-name.com's tmp directory..... it says
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Options None
Options +FollowSymLinks
Again, not sure if that matters. If you have a moment for a nOOb, how should I resolve this?
Comments
Contact your hosting provider
Your directory access has been restricted by your hosting provider via the php.ini's open_basedir restriction. This prevents php from accessing files outside the open_basedir settings.
Well, the restriction cannot
Well, the restriction cannot be lifted, but it doesn't seem to me that it would be a problem with the configuration of open_basedir. They have a path to "/home/www/correct-domain-name.com" listed as I would think it should be.
I was assuming that somehow drupal is storing the old path, "/home/www/old-and-wrong-domain-name.com/tmp" in the database. I couldn't find it via a search of the drupal installation's files.
Seems to be looking for a directory on the old path...
It seems like the problem is it's looking on this path: /home/www/old-and-wrong-domain-name.com/tmp
But the server files are on a new path: /home/www/correct-domain-name.com
I can't figure out why it still is looking along the old path. I can't find a reference to it in settings.php or anywhere else.
Do I have that right? Why would it do that and what should I do?
Hello Juhister1021 You'll
Hello Juhister1021
You'll need to alter the base path in settings.php
You'll need to alter the paths in your cron script
I dont know what modules you have but you will need to alter some modules settings as well. Anything to do wth images for sure.
Check all your modules for path settings
Any paths you had in say a post , likw for instance an image that might be sitting in your files , even smilie images , will have of course the old url . They will generate a page not found in your logs so you'll need to edit the post and change the path. Very tedious if not impossible on a very active dynamic site.
Your best bet for the sites homepage is a 301 redirect. If your host has cpanel you should be able to that easily enough.
Hope that helps
Thanks
In approaching this problem with the clean white slate that is the mind of the utter n00b, I got all of the current versions of the files to my local setup via FTP and did a search for the string "169" which was in the old web address. It wasn't in any of the PHP or other files so I assumed that my problem was held in the db.
I did change the base path in settings.php, though that hadn't been set previously to the old base path. I'm in a situation where I have to use poormanscron but looked at cron.php and didn't find anything there to update.
The errors were popping up regardless of whether one were on the old domain or the new so a 301 wouldn't help.
In the end it was an easy fix (if you know about it, right) -- see next post.
Change Temporary Directory
I had the same problem moving my site to a new hosting. I solved it changing the Temporary Directory in "www.mysite.com/admin/settings/file-system" from "/tmp" to "sites/default/files/tmp".
Tried to follow this -- IT WORKED !! (see edit)
Thank you for this reply, tarleman. I tried to follow this reply but I don't have an admin/ or admin/settings/ directory in my installation. I looked around for something named "file-system" but couldn't find.
Am I interpreting you correctly that these are folders or directories that exist on your site? Or is this a reference to a line of code found in a file somewhere? If so what file did you make the change in?
Thanks.....
EDIT:
Oops, I am displaying my newness to Drupal like a peacock in full feather. I was looking for a series of directories in my FTP client instead of a string of nodes/subnodes in the URL......
I am documenting my ignorance for others like me who follow. I did what tarleman suggested, went to Administer > Site Configuration > File System, which displays as a URL in the browser just as tarleman described.
All I had to do was update the temporary directory path with my new domain name.
One other note
Here's another one for the newbies
I compared the file system settings for my problem site to another fresh install.
I don't know why the problem site was set that way ... quite confident that it wasn't something I did (on purpose, anyway!). But had it been /tmp, I believe that I wouldn't have had an error in the first place. Hoping this info comes in handy for someone else down the road.