Localhost is no longer working properly - xampp

I just built a site using Xampp and it worked great. I just transferred my site (that I used to develop by updating to live server) to localhost, and it isn't working right at all.
The images do not show and the pages are not refreshing properly.
I had to change the CSS images to /folder/x instead of just x, which I can understand I guess, but why are my HTML images suddenly not working?
One of the pages, the paths are even absolute, but the page just isn't updating even though it's saved in the local folder.
What gives? All I did differently was added a password to root user in MySQL and tried (and failed) at some mod_rewrites, which I removed.
It points the images from localhost/ instead of localhost/folder, even adding folder/x doesn't work.

You probably forgot to convert a link or made a mistake.
Remember that /images/x.png means that it's trying to find the folder images from root and not from the current folder your site is located in. Try using ./images/x.png instead.
Perhaps you could post an example from your site?

Try looking at the Apache access logs and see whether you can find a request for an image with the wrong path.

Related

Change document root of Laravel

When I place a Laravel project into Apache's document root, say /var/www/html, it works when I point a browser at it.
However if I put it under a directory under Apache's document root, for example /var/www/html/myProject, it doesn't work when I point a browser at it.
Is there anyway I can change this behavior?
Thank you very much.
Edit:
When I put the Laravel project off a sub-directory off /var/www/html, Laravel complained that it could not write to the file laravel.log. After checking and changing the group ownership of the sub-directory, the index page came up normally.
However, the background image was missing, even after I changed the URI in the CSS stylesheet.
Furthermore, when I clicked on any link from the index page, I got a 404 Not Found Error. This is an Apache 404 and not a Laravel 404, which is styled differently.
OTOH, if I run the PHP server off this sub-directory and point my browser at localhost:8000, the links serve up pages correctly.
Thank you for your help.

Xampp doesn't reload changes when files get updated

When I copy live opencart website to the local xampp, can't show any updates
I had a working local copy on my localhost, but I needed to get the most updated copy from the live site. So I copied the live site and the live db(in workbench). Then I changed config files(both admin and catalog). The website works perfectly on local browser, but the changes I do through code doesn't show on browser. But when I change my database to the old local db I can see updates.
No errors showing on browser
Thanks
"As a developer, or store owner, you may make a change somewhere in your online shop and not see that change being applied on the front-end. In that case you probably need to clear your caches, but there is more than one so it helps to be aware of what caches there are and how to clear them."
https://www.antropy.co.uk/blog/how-to-clear-all-caches-in-opencart-3-0-2-0/
I've solved the above issue using Twig/SASS (Template) clear cache method. I have to do this for each update. But then I got another issue - the default image on product category doesn't show up. Image src shows as unknown, which fetch from cache folder. Any solution for this please?

Read image files from non-default directory in PrestaShop 1.6

Hello Stack Overflow community, I have installed PrestaShop 1.6.0.14 in a Xampp server a few weeks ago for the company I work for. They have a web application that handles all the image files from their websites, for example, when a user opens an image with right click->open image in different tab or similar, the url shown is something like:
http://www.example.net/FileViewer/File.aspx?Type=3&File=WebsiteFileDirectory/img/logo.jpg&Width=138&Height=50
As you can see, after the &File= part comes a directory structure and some parameters to handle the image at the end. This directory (WebsiteFileDirectory) is located in C:/StorageFiles/Volume1/, where the web app for image handling looks for file sources.
My PrestaShop /img/ folder needs to be in that location with a directory structure similar to C:/StorageFolder/Volume1/PrestashopFileDirectory/img. So far, I've moved /img/ to that location and managed to make Prestashop write into the new location by editing the constant values _PS_IMG_, _PS_IMG_DIR_ and _PS_CORE_IMG_DIR_ in config/defines.inc.php and config/defines_uri.inc.php
But after that I've hit a brick wall when trying to make PrestaShop read from that location, I've even tried editing the LinkCore::getImageLink() method by hardcoding a uri_path value pointing to the directory mentioned before, with no results whatsoever, PS will try to read from the default location (something like myshop/16-small_default/image_filename.jpg)
How can I make PrestaShop read from that location? Is there even a way to do that?
Thanks in advance.
P.S.: Just to make sure I get a straight forward answer I want to let you know that by now I figured how the image file system in PS 1.6 works, if the image id is 25, PS will store the file in img/p/2/5/ for a product image, I have no problem with anything related to that.
Well, it turns out that getImageLink must be fed a URL (from the image handling webapp I mentioned before), not a filesystem path. So, the uri_path variable in this method would look like:
$uri_path = 'http://www.example.net/FileViewer/File.aspx?Type=3&File='.$my_img_directory.'&Width=138&Height=50';
The methods I have figured so far that need similar tweaking are getMediaLink and getCatImageLink, from the same Link class in the classes/Link.php file.

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.

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

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

Resources