PHP code changes not being taken

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
oscah
Forum Newbie
Posts: 2
Joined: Mon Feb 01, 2010 3:05 pm

PHP code changes not being taken

Post by oscah »

Hi,
I am brand new to PHP coding.
I had copied over a php script and made some changes to it on a debian server - just added a line where i instantiate and assign a variable some value, and write it to a file. i saved it and closed it. I see the link to my new modified script on my browser, but i dont see any changes that i made to it, when i run the script to get the values. i made another print statement change, just to make sure at least that appears, but even that does not. Any ideas what might be going wrong? it is really wierd.
however when i make the same change to the original script from where i copied, everything seems ok, and all my changes are visible, so i am not doing anything wrong...

Thanks.
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: PHP code changes not being taken

Post by social_experiment »

Could you please paste the code?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: PHP code changes not being taken

Post by califdon »

That sounds like the old "wrong directory" problem. Make sure you are saving the file to the same directory that the web server is serving it from.
oscah
Forum Newbie
Posts: 2
Joined: Mon Feb 01, 2010 3:05 pm

Re: PHP code changes not being taken

Post by oscah »

Hi. I am saving it to the same directory as the original code. I do see the link on the web browser. But are you talking about something else?
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: PHP code changes not being taken

Post by califdon »

Well, more than once I have had a directory structure where a particular file is in, say, a subdirectory, but when I updated the file I carelessly saved it to the root directory, so although I updated the contents, the file that the server is delivering to the browser was the unchanged file in the subdirectory. It's very easy to make this mistake. If you are certain that the file that the server is delivering is the one you have changed, then that is not the problem.
Post Reply