Odd Script Behavior since Windows Upgrade

My employer provided me with a new laptop last week (with windows 10) and now it seems that whenever I update code in my PHP scripts it causes some wierdness (odd issues that I have never seen before).

Prior to this I was using Windows 7 and XP before that and never had the issue.

I have to pain in the butt examples to provide. Hoping someone can shed some light for me.

  1. scripts that so any kind of searching and replacing are not behaving properly. So code that use str_replace() does not seem to find and replace what it needs to. All I did was update some code in a file that uses the str_replace() and the function stopped working as expected.

  2. the application above has another component that sends html email. Now when emails get sent, they are not formatted in html anymore. Everyone just comes in unformatted.

At this point I am afraid to work on others applications in my infrastructure as I fear those will start acting oddly as well.

All I can think of at this point is perhaps an encoding issue with my text editor or Windows? I have no idea though.

For the most part i use notepad++ and winscp to code.

In the past I would sometimes work directly on the server (has samba installes) but I cannot do this anymore as it’s an older server and the policy on our windows 10 machines and work blocks doesn’t let us connect to older SMB protocols.

Does anyone have any ideas? I am stumped.

Thanks,
Frank

First step, check the logs to see if it sheds light on what is occurring.

Hi astonecipher,

Thanks for the reply. I have tailed the apache error log and I do not see any errors. I have error_reporting set to E_ALL as well – no complaints… the scripts I suppose technically are working – just not playing nice anymore for some reason since the windows 10 update last week.

Server environment is the same as well… .no changes on that end (older ubuntu, older php, older apache unfortunately – it’s a legacy system on a private LAN – no budget at the moment to upgrade).

Thanks,
Frank

that is really odd, unless something was updated on the server as well, and that is the reason it is not playing nice anymore…

It is a pickle that’s for sure. Nothing has changed on the server. Only difference is that I’m developing on a new workstation. I will keep plugging away. I will post an update if I manage to fix whatever is causing the issue, and ask around to see if there ae some other changes that I do not know about – anything is possible.

It would take knowing what the str_replace() is trying to do or if the code is even being executed and to what and how the email header is being set to in order to narrow down the problem.

A likely possibility is that the code is using php header() and/or setcookie() statements and the files you have been editing are being saved as UTF-8 with the BOM (Byte Order Mark) characters and this is preventing the header/setcookie from working, which is then causing other issues/symptoms…

Another possibility is the new-line characters that the files are being saved with are now different from the new-line that php is using,

Have you confirmed, using a phpinfo() statement, that the error_reporting and log_errors settings are truly set so that all php errors would be logged?

Sponsor our Newsletter | Privacy Policy | Terms of Service