<xmp> <meta name='google-adsense-platform-account' content='ca-host-pub-1556223355139109'/> <meta name='google-adsense-platform-domain' content='blogspot.com'/> <!-- data-ad-client=ca-pub-9252412571485847 --> <!-- --><style type="text/css">@import url(https://www.blogger.com/static/v1/v-css/navbar/3334278262-classic.css); div.b-mobile {display:none;} </style> </head><body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d6237629\x26blogName\x3dSkai+Chan+Kai+Lun\x27s+Blog+%5Bsillydumb.c...\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttps://sillydumb.blogspot.com/search\x26blogLocale\x3den_US\x26v\x3d2\x26homepageUrl\x3dhttp://sillydumb.blogspot.com/\x26vt\x3d-900517007015619153', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe", messageHandlersFilter: gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER, messageHandlers: { 'blogger-ping': function() {} } }); } }); </script> </xmp>

Sitemap / Terms of Use / Music / Useful Links / Contact Me


Tagboard
Trying to find time to script it myself.
My Sites
My Friends
Latest Entries

Subscribe to
Posts [Atom]


HOME > MY BLOG >



Tuesday, September 29, 2009


Changing File Permission on Web Server

My “Current Online Users” counter was working fine until I switched webhosts.

I remembered clearly I needed to change the permission of the text file on the server before it could work for I was not using SQL database. However, no matter what I tried, even to the extent of changing the permission for the folder, the counter refused to work.

I asked around my friends but none of the programmers was familiar with writing and reading a text file using PHP. I tried to google for solutions but it did not help, until I found on “www.php.net/fwrite” the line “PHP does not recognise the permissions setting for the file until you restart the server”. It stunned me for quite a moment. I was not using a dedicated server and I was not running the website on my personal server or computer, and it would be troublesome to get the server reset; moreover, I could not confirm it would work.

It actually took me a few days from assuming the servers were problematic to suspecting my FTP application was buggy, and finally to the urge to try debugging. My knowledge of the script was too shallow to spot any problem; moreover, I supposed there could not be a mistake since I had been using the same script for years. I started by adding codes into the different files for prompting. The last thing I did was to do a trial and error to remove a space/tab between a “3” and “000”, which aroused my suspicious. It finally worked.

I concluded that changing file permission was an immediate effect, which did not require restarting of the server. However, it might not always be the case for some extremely lousy servers that could or could not have existed.

Labels: , , , , ,


... Skai (Kailun) dreams @ 3:41 AM

0 Encouragements:




Sweeten my dreams (0)

<< Latest Entries




 

v. Dear Dreams. Copyright © 2001-2008 Skai Chan. All rights reserved.
Go to Top ^


Fight Spam! Click Here! Top Personal blogs Personal blogs