views:

82

answers:

3

hi, i was working on the localhost and every thing was just fine, but when i upload to my site it get alot of errors

why is that ?

(sorry for my bad english)

+1  A: 

You might have hard-coded references to include files. You should use $_SERVER['DOCUMENT_ROOT'] instead of hard-coding filepaths because on a local windows PC your path will be something like C:/path/to/my/webroot whereas, for example, on a Linux shared-hosting production server your path will be something like /home/user_name/public_html/.

jwhat
@jwhatno, but good info... thanks i realize that when i upload it via FTP all files that contain many lines will be in just one line... so i replaced the // comments style to /* */ stylebecause it was the problemthanks
Abdulrahman Ishaq
You shouldn't have to do that. Sounds like you have some sort of compression setting enabled on your server that is removing all white-space.
jwhat
or myabe the problem on my FTP program 'filezilla' ?i tried to change my hosting many times (it's free one), all are doing the same
Abdulrahman Ishaq
I use Filezilla on both PC and Mac and have never experienced this problem.
jwhat
+1  A: 

Based on little details of the errors you are seeing...

You might want to look to doing the following:

  1. Replace all references to localhost with relative links or $_SERVER['SERVER_ADDR'] (kind of similar to jwhats answer)
  2. Make sure that you are uploading the files in the same folder depth as when running locally.
  3. Maybe your php setup is different locally to you remote site setup? E.g you have search paths added in local php.ini or you have some php modules missing on your remote site that are used in you code?

But exact errors would help people to answer more detailed :-)

DEzra
A: 

Typically, errors like this are a result of permission issues.

Anonomouse