0
votes

I used to have a Windows OS server where i uploaded some old php web files to it. I could then access them, edit them, and view them online via my host name.

After much debating and reasoning, we had to change the OS of the server from Windows to Linux. After the change had been completed, a backup of the server was uploaded to the new Linux installation where all my old files were kept.

I could view these files online as I used to do when the server had windows OS.

The only thing I did encounter was the following:

a) I downloaded my files from the server using putty, b) I deleted the old copy in my Linux server, c) I then re-uploaded the same file that used to be in the server without making absolutely no change whatsoever to it, to the exact place where it was, d) When I try to access it via its web address like I did earlier, it throws an error message saying..."The page isn't working".

I don't know much about Linux and there fore I am stuck. I don't know what the problem is. I can't understand why I can view all the files via their web address if they were placed there from the backup, but when I download them, delete their file from the server and then re-upload the exact same downloaded file to the exact place where it used to work, I get an error message.

enter image description here

Extra info: I connect to this Linux server from a windows OS machine using putty.

1
Php version of both Server and my codding are 7.1 - Adnelon1
Internal server errors implies that your script failed. Check your logs. - Script47
@Script47, how do I checked the error logs in the Linux server? Iknow there is a folder called "Log" but when I open it there are some files called: boot.log btmp dmesg maillog secure - Adnelon1

1 Answers

0
votes

I found the problem. Since I migrated from a Windows OS server to a Linux Cent OS server, I didn't know that you had to configure the privileges of each folder in order to be accessed from the web. By default, my uploaded files where tagged by ownership of "user". The server was configured to only display files that were tagged by ownership of "root". The way I solved this was by typing the following command in the terminal.

NOTE: "You have to be in the folder where the file you are going to change ownership is."

sudo chown root:root filename.php


sudo -> Execute in admin mode
chown -> Change ownership of file to...
root:root -> ... root instead of user
filename.php -> the name of my file

Executing this corrected the error. Hope it helps someone else since I coudn't find anything related.