PHP saves image, can't access it

in Wordpress

Junior Member

joined:Jan 30, 2008
posts:104
votes: 0

I'm building a custom WordPress theme that includes multiple admin pages, including one that deals with photos. My script takes an uploaded photo, resizes it multiple times and saves the results into their respective folders. Everything works properly on my local Ubuntu development server, but when I took it live on my BlueHost account, it went all screwy. I know the photos are being saved properly because I can download the new images and they work properly. It seems that whenever I reference the new photos in an image declaration, I get nothing. It says file not found, and I'm almost certain the path is right. I'm running the test setup in a subdomain on my main hosting account.

Preferred Member

Junior Member

joined:Jan 30, 2008
posts:104
votes: 0

The images and parent folders all have 644 permissions (I tried 777 temporarily to see if that made a difference) so I believe the server has access. The plugin script uses WP's template system, so it's not really a script per-se, more of a function. Should I make the actual file 644 too?

For images or other resource references from within a web page, always start with /. This means "start at the domain root" and will work no matter how many directories deep you are. For PHP functions, always use the FULL PATH. So the two above examples can be