Jump to content

Recommended Posts

Hello. My companys website has switched servers, from A Plus to Hostgator, and ever since, when trying to upload files to our "current exhibitions" page via the admin tool, we have been getting error messages. They seem to refer to our old server and specific files but I am not sure what they mean. If anyone could help us it would be greatly appreciated! This is the error...

 

Warning: copy(/services/webpages/util/b/o/borissamarov.site.aplus.net/public/i/exhibitions/MLKShowPressReleaseImages.jpg) [function.copy]: failed to open stream: No such file or directory in /home/panopt/public_html/include/classes/com/interabet/File.inc.php on line 16

 

Warning: copy(/services/webpages/util/b/o/borissamarov.site.aplus.net/public/press/MLK2010ShowPressRelease1.pdf) [function.copy]: failed to open stream: No such file or directory in /home/panopt/public_html/include/classes/com/interabet/File.inc.php on line 16

 

Warning: Cannot modify header information - headers already sent by (output started at /home/panopt/public_html/include/classes/com/interabet/File.inc.php:16) in /home/panopt/public_html/admin/exhibits.php on line 54

 

Link to comment
https://forums.phpfreaks.com/topic/188497-error-message-please-help/
Share on other sites

The first two errors are because whatever file your copy() function is pointing too doesn't exist. Make sure you update the file paths to reflect what they are on the new server.

 

and the third error is a very common error that results in trying to send a header (using the header() function) after you have output something to the page (this means anything, from whitespace, to html tags). We would have to see some code to be able to help more though

The first two errors are because whatever file your copy() function is pointing too doesn't exist. Make sure you update the file paths to reflect what they are on the new server.

 

Thank you very much. However I am still not sure what to do. I do not know much php, so im not sure how I can check what files are in my copy() function and edit that. I am also not sure how to update the file paths. If anyone could help me or let me know if its too complicated what step I can head in, I would greatly appreciate it. Thank you.

Line 54 is un-needed as PFMaBiSmAd has already stated.

As for the first 2 errors you need to look in your file system and see if those files do exist in those directories..

We cant help you with these errors because its a file location problem, we can only offer advice on what to do.

Talk about pulling teeth to get information to use to help :examine:

 

Best guess on this one is that the variable $this->dir contains the intended target directory where the uploaded files are supposed to be copied to. You would need to locate the code that is setting $this->dir and change it to point to the directory on the new server where you intend your uploaded files to be copied to.

Talk about pulling teeth to get information to use to help :examine:

 

Best guess on this one is that the variable $this->dir contains the intended target directory where the uploaded files are supposed to be copied to. You would need to locate the code that is setting $this->dir and change it to point to the directory on the new server where you intend your uploaded files to be copied to.

 

ouchh lol. oh well. im a beginner at this.

i hate to sound even more of a beginner but... whats the harm? so i am not sure what any of this really means and am unsure where the directory is with the uploaded files. you said that  $this->dir contains where the target directory is, but how do i access this? thanks...

$this->dir is a variable inside a class that contains the directory its looking for.. You need to look into the class and find WHERE the $dir variable is being set. It could be a cell in a database that needs to be updated or something as simple as a configuration file.. without seeing the whole File.inc.php file we cant give you any more ideas..

i appreciate all the help u guys r great.

does this help at all? the file.inc.php...

 

<?php

class File {

var $name;

var $tmp_name;

var $dir;

 

function File($File) {

$this->name = $File['name'];

$this->tmp_name = $File['tmp_name'];

}

 

function copy() {

if(is_file($this->tmp_name)) {

$count = 0;

while(file_exists($this->dir.$this->name)) $this->name = $count++.$this->name;

if(copy($this->tmp_name, $this->dir.$this->name)) return true;

}

}

 

function delete() {

if(is_file($this->dir.$this->name)) return unlink($this->dir.$this->name);

else return false;

}

}

?>

 

 

 

 

the person that made the website is no longer available. i am not sure if the files are in a database like MySQL (i am not sure if that even would make sense, bare with me please lol) or somewhere in the files I have. any comment is appreciated, thanks

LOL (Sorry to be overly blunt, but like part of my signature states, knowing enough of the language being used is a prerequisite.)

 

Somewhere in your code there are a couple of lines of code like this -

$something = new File();
$something->dir = "/services/webpages/util/b/o/borissamarov.site.aplus.net/public/i/exhibitions/";

 

$something may in fact be any variable name, the two lines of code won't necessarily be together, and the /services/webpages.... value may in fact not be that whole string (depending on what amount of the information from the error is in $this->dir and what amount is in $this->name) or can be composed of more than one thing, including but not limited to quoted strings, other variables, or defined constants...

 

Do you have a programming editor, like notepad++ (not to be confused with MS notepad) that would allow you to globally search at one time through all the files in all the folders that make up your application to find where either the relevant code is at or to find where the current setting is located?

If you have your entire site backed up locally you can use dreamweaver to do a 'Find in Files' type search for the dir string. dont search for the WHOLE string, just a portion of it like '/services/webpages/'

then look at all of the results for the ones that look something like this..

$foo->dir = '/services/webpages/.......';

 

Once you have found the directory strings in question you need to replace them to match the setup of your NEW site's file structure..

so i found the file that leads to that place and must be changed. it is in a file called common.inc.php. thanks, i feel like were almost there. so this is part of that file that i probably have to change...only i am not sure what i exactly change and what to...i assume its just here, and i change the string to a new directory where the photos should be? or do i have to go into the database server etc. and do something there..or am i just complicating things? thanks

 

//production

else {

$DIR_UPLOAD = '/services/webpages/util/b/o/borissamarov.site.aplus.net/upload/';

$DIR_PHOTO = '/services/webpages/util/b/o/borissamarov.site.aplus.net/public/i/photo/';

$DIR_PHOTO_THUMB = '/services/webpages/util/b/o/borissamarov.site.aplus.net/public/i/photo/thumb/';

$EMAIL_CONTACT = 'gallery@panopt.com';

 

$DATABASE_SERVER = 'sqlc40b.carrierzone.com';

$DATABASE_SCHEMA = 'borissamarov';

$DATABASE_USERNAME = 'borissamarov';

$DATABASE_PASSWORD = 'deletedsonobodywillhack';

}

?>

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.