Tweet |
I am working these days enhancing an old project .
I am writing some tweaks in a php page , that prints html code , and sometimes javascript code , that is included from another php code , that reads a cached file and writes a js array and then prints html code .
The legacy application connects to MsSql database , and for making a development virtual machine , we were obligated to run the application on windows xp , installing xampp and we started the game .
Always the first level is easy , some minor enhancements were required , and we were done .
But the post levels were tricky , some pages were not working at all , I struggled to find the reason , and I was surprised when I found it .
Some php pages where including some other pages , a way like this
Of course that was not working in Windows Xp , as there is now "/var/www" in windows platforms , so I learned a new lesson , when writing an application , the safest way to include files is to make one file of configuration that holds all the root folders as constant variables .
And when including specific files , you use those variables , and change it whenever you want , for example if you change the environment .
I love Linux .
I am writing some tweaks in a php page , that prints html code , and sometimes javascript code , that is included from another php code , that reads a cached file and writes a js array and then prints html code .
The legacy application connects to MsSql database , and for making a development virtual machine , we were obligated to run the application on windows xp , installing xampp and we started the game .
Always the first level is easy , some minor enhancements were required , and we were done .
But the post levels were tricky , some pages were not working at all , I struggled to find the reason , and I was surprised when I found it .
Some php pages where including some other pages , a way like this
include "/var/www/lib/ClassName.php" ;
Of course that was not working in Windows Xp , as there is now "/var/www" in windows platforms , so I learned a new lesson , when writing an application , the safest way to include files is to make one file of configuration that holds all the root folders as constant variables .
And when including specific files , you use those variables , and change it whenever you want , for example if you change the environment .
I love Linux .
0 comments: