Cannot upload images when WordPress is sat on a virtual host configuration - image

This is my first post to this Forum, please forgive me if this has been answered elsewhere--I did search and was unable to find an answer to my particular problem, so any help would be greatly appreciated.
I am working on a WP site for a client who wants to upload images to new posts (who doesn't hey?). In setting up the site I have done the following:
1) Enabled File Upload by CHMOD default dir to 777.
2) Changed max file size.
3) Changed allowed filetypes to include necessary file types.
When I try to upload anything I get the following error:
“Bobst Expertfold 80 110 (Dec 2010).jpg” has failed to upload due to an error
The uploaded file could not be moved to /var/www/vhosts/glossopcartons.com/httpdocs/wp-content/uploads/2010/12.
The above error mentions 'glossopcartons.com', this WP site is actually sat on glossopcartons.co.uk. It's obvious that there is some kind of virtual host configuration going on and the image is trying to be uploaded to a folder on a different domain (glossopcartons.com instead of glossopcartons.co.uk).
I don't manage the hosting, I have just been assigned with the build. However, I have access to the plesk cpanel but I dont know what I need to do?
Does anyone know what is causing this problem? The site has actually been made live and this issue has been spotted after the launch(everything worked fine on the test server), and I am scratching my head trying to figure it out.
Is there something I can put in my wp-config.php or .htaccess file to tell WP to upload to a different location.
Any help would be greatly appreciated.
Dan

First thing is 777 permisions are too loose and will get you hacked; they should be no more than 755. Hardening WordPress « WordPress Codex
For the difference in URLs: that sounds like a DNS or virtual host config, but try adding the full URL path in Settings>>Media Settings. Might not work.
Why are there sites at both domains? Why not domain forward glossopcartons.com to glossopcartons.co.uk?

Make sure PHP lets you upload files larger than what you are trying to upload.

Experienced the same problem on several old sites. This problem occurs sporadically and is not commonly occuring on other websites on the same server
Try going to your "Media Settings" page... do you see a "Store uploads in this folder" option with a long path to your uploads folder? If so... this is your problem... WordPress 3.5+ does not seem to require this long path, but more of a site relative path (which is great!)
Change your "Store uploads in this folder" to "wp-content/uploads"... when you "save settings" you should see that field disapear entirely, never to bother us again ;-)
This occured for me when my hosting provider changed the folder structure on the server making this long URL incorrect. Therefore WordPress could not find the "uploads" directory at all.
Hope that helps...
Here's some things you might want to check in case your still having problems...
Update to WordPress 3.5 +
Update all plugins
Check file permissions 755 on the uploads dir/
Check PHP version

Related

Laravel XML sitemap, location, shared hosting

I've uploaded a Laravel app, to a shared hosting provider (I know it's not the best, but it's for a local charity and everything needed to be free) The hosting is actually not bad, they allow SSH and I've managed to get Composer and Artisan running through PuTTY.
I followed the steps, for shared hosting uploading a Laravel app,, everything is running fine, so far.
I've been trying to upload a sitemap, to Google, but I keep getting a not found error. I've had the file in the root, the public_html and the folder that contains the logic, in my case wmcc.
None of these seem to work. I've generated my sitemap, in Screaming Frog, although I have used a couple of online ones, too. I've set my robots.txt file, I'm just out of ideas, where to place the xml file, if anybody can point me in the right direction, please? thanks

Hostgator Addon Domain Redirecting to Primary Domain Subdirectory

This is for a client so I won't share exact domains but the problem is as follows..
I took over development of a website from a prior developer.
The hosting is Hostgator Business.
The primary domain is primary.com.
There is an addon domain addon.com.
The primary domain document root is /home1/username/public_html.
The addon's document root is /home1/username/addon.com.
www.addon.com had a WordPress installation which the developer had edited instead of using plugins to achieve his goals. The site also needed a complete redesign so I felt it logical to simply wipe the installation and replace it.
So, I deleted all of the WordPress files and uploaded a new copy of WordPress from wordpress.org/latest.tar.gz
Prior to deleting the old installation, the domain loaded files from it's document root perfectly.
After uploading the new installation instead of resolving to addon.com it is instead resolving to primary.com/addon.com
I've never seen this happen before so I'm lost.
There's no errors in any available logs.
All file permissions are correct.. I've triple-checked.
I've tried deleting all files and creating simple index.php and index.html files to see if it would access them ... it doesn't.
This happens in each browser I use on Windows and Linux.
I don't understand it because all I did was swap out the old WP install for a new one.
I went and re-uploaded the old WordPress installation so everything is 100% how it was but it is still going to primary.com/addon.com instead of addon.com.
Has anyone faced this issue before? I usually use Bluehost but even when I've used Hostgator in the past I've never seen this happen.
I double-checked the addon domain settings as well as anything else I could think of and everything appears normal.
I even deleted the addon domain and re-added it with the document root of /home1/username/addon.com and it still goes to primary.com/addon.com in the browser.
I submitted a ticket with Hostgator but they have not replied yet.
I'm sorry if this is long. This is my first time asking for help on here and I wanted to be sure I included everything I could.
Hostgator finally got back to me.
The previous developer had used the one-click WordPress install.
Apparently once someone uses a one-click install the only way it works is if you keep using the one-click install/you cannot do it manually any more.
From all the servers and sites I've setup this makes no sense and is a problem with Hostgator. Support did not really tell me anything other than "you have to use the one click install since the prior developer did". Great service.
Hope this saves someone some hassle.
From this it sounds like you were moving a WordPress site from the primary domain to an add on domain.
Simply moving the files from the primary to the add on domain will not make it work on the add on domain because in the database and throughout the coding of the WordPress site it would all be configured and coded for the primary domain.
It sounds like you would need to update the site home and site url from the primary to the add on domain url.
http://support.hostgator.com/articles/specialized-help/technical/wordpress/wordpress-home-fix
Also I would be suggest using a search and replace type plugin to go through all the internal coding to update the urls and links to the add on domain.
There is more information here as well http://codex.wordpress.org/Moving_WordPress

Joomla backend not shown correctly

I'm using Joomla 2.5 and the backend is not shown correctly. It seems that the template is not loaded correctly.
This is my page:
http://www.fussball.tsg-kastel.de/administrator/
The page as such is shown correctly but as you see, the backend isn't...
Try doing this:
Rename the admin templates folder on the host server (for a backup)
FTP transfer of an admin template folder from another Joomla site and then copy it from the FTP location using a file manager into the admin templates folder.
You could have a corrupt file or just missing some files from installation. This has happened to people before and by doing these two steps it seemed to solve their issue.
Hope this works out for you.
You probably have a fatal error. Go to configuration.php and change error reporting to development. This will render the error to the browser (alternatively check your apache error log). I predict you probably have a plugin problem -- perhaps your host updated PHP version for example. Whatever it is, deal with that problem.

Megento dev site re-directing to live site URL

I'm having a huge issue with accessing my dev site. I two magentos sites on different servers. One is the dev site, the other live. However I needed to copy the database from the live to the dev site.
Ever since i did this i've had problems with accessing the dev URL. As it keeps re-directing me to the live site. I've googled the issue and tried the following:
Accessed the 'core_config_date' and changed the unsecure/BASE_URL & secure/base_url and changed them back to the dev URL.
I then went to clear the cache on the dev site, which had already been cleared from when i was installing a plugin.
Set everything to 0 in 'core_cache_option'.
Cleared cache on my browser
But i'm still getting the issue of the site re-directing to the live URL.
I've noticed a few people had had the same problem, but the above solution doesn't seem to be working for me. Any help would be much appreciated.
Thanks
Right so managed to sort it. It was a permissions issue. I overlooked it as I didn't have a linux user setup for this site. However the folder user was set to 'root' as opposed to 'www-data'.
For anyone with this issue in the future, I strongly recommend checking permissions on the server/folder for caching.
Steps to fix the issue:
Change base URL in the 'core_config_data' table (can be found on line 5 or 6, give or take)
Check permissions on your siteroot/var folder. Delete everything from /var/session & /var/cache
Run 'chown websiteuser -R siteroot' and then 'chmod u+w -R siteroot' for permissions changes.
That should be enough to get it working.
Do the below steps in your development server :
1) Check the development server database hostname,username, password in your config.xml file in below path : app/etc/.
2) Open your live server database in any editor and find the live site url entirely.
and replace with your development server url with searched result.
above two steps will solve your issues.
here after it will now solve.
3) Check your .htaccess file in your root folder to check the any redirection rule.
Check your file permissions and set them properly so Magento doesn't end up creating a MagicCache in the system /tmp folder which is where your core configs are being cached, allowing for you to clear var/cache till the end of time and have the settings in the database never take.
All over here Can't change Magento base URL -> Stuck in cache

Forbidden You don't have permission to access /appetitclic/wp-content/themes/Apc/img/logo.png on this server

Hello all :)
I am currently working on a WP website and a the moment I am working locally with Wampserver.
None of my pictures happen to appear on my website.
Here is the error I get when I put the image url in my browser :
Forbidden
You don't have permission to access
/appetitclic/wp-content/themes/Apc/img/logo.png on this server.
I have no problem accessing phpmyadmin and image from TewentyTwelve template work fine.
Things I have tried :
-Editing (and creating) .htaccess in wp-admin.
-Editing phpmyadmin.conf
-Puting Wamp on online mode
-Working through http://127.0.0.1/ instead of locally.
I am pretty sure the problem doesn't have to so with the code because I have access to the /appetitclic/wp-content/themes/Apc/img/ folder and I see the list of images (not working). I maybe missed one or two workarounds but I am pretty sure I tried most of the common ones.
If you need any info on my setup / configs I have tried ask away.
Thank you very much,
Cheers.
If you start your relative url with a backslash '/' that means go to the servers root folder and work up from there.
Try loosing the leading slash and see what that does.
I have that same problem when I downloaded random images for img preloading testing.
So I went to change permission from no access to read & write (if on Mac then > Get info. You shall see that permission section at the very bottom).
You might use chmod to change permission to particular users.
Hope this help.
I had the same problem today. I created a static webpage put in the html folder of my web server. It turned out that some images could not be loaded. The solution is quite simple. I just right click the image folder and changed the properties to allow readers to view the images.

Resources