For our convenience we need to prepare two usefull funcions, first to start timer, second to stop it and log some information into the log file.
//this funcion starts timer
function startLog(){
global $startTime;
$startTime = microtime();
}
//this funcion stops timer and logs some information to log
function stopLog($info){
global $startTime;
$startT = explode(’ ‘, $startTime);
$endT = explode(’ ‘, microtime());
$workTime = ($endT[1]+$endT[0]) - ($startT[1]+$startT[0]);
$f = fopen(’performance.log’, ‘a’, 1);
// time work_time info REQUEST_URI REMOTE_ADDR HTTP_USER_AGENT
fwrite($f, date(’m-d-Y H:m:s’) . “\t”.$workTime . “\t[” . $info . “]\t” . $_SERVER[’REQUEST_URI’] . “\t” . $_SERVER[’REMOTE_ADDR’] . “\t” . $_SERVER[’HTTP_USER_AGENT’] . “\n”);
fclose($f);
}
NOTICE: you must ensure that your www serwer (for example Apache) can write to specified location - where your performance.log file should be placed.
now you should
]]>“Adsense Notifier simply shows your adsense stats on the status bar and updates the stats automatically. This is wonderful for anyone with OCD ( or GAD as some have called it ) who needs to check their stats every three seconds to see if they have gotten any more clicks :-p”
read more and download it at: mincus code ยป Adsense Notifier
]]>checking for C compiler default output file name… configure: error: C compiler cannot create executables.
Solution:
Just install glibc-devel
that’s all.
]]>Warning: fopen() [function.fopen]: URL file-access is disabled in the server configuration
Warning: fopen(http://somelocation.com/somefile.xml) [function.fopen]: failed to open stream: no suitable wrapper could be found in /home/someuser/somephpfile.php on line [someline :-)]
???
It happens if - for security reasons fopen is restricted to open remote files. If it is on a hosting server and you cannot change configuration you may try curl. Example below:
instead of:
$file = "http://somelocation.com/somefile.xml";
$fp = fopen($file, "r");
try the solution with curl*:
$file = "http://somelocation.com/somefile.xml";
$ch = curl_init($file);
$fp = @fopen("temp.xml", "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
$file = "temp.xml";
$fp = fopen($file, "r");
That’s all
* - ensure that you have write access - so curl can write to temp.xml
]]>it’s simple, for example to convert all *.php files in directory write:
for x in *.php; do dos2unix $x; done
AuthUserFile /home/username/htdocs/.htpasswd
AuthName “Password Protected”
AuthType Basic
require valid-user
Of course in the AuthUserFile type in the location of the .htpasswd file (i.e. when you want to store that file, you’ll create it in next step)
2. Set password for the user(users) (-c option creates .htpasswd file)
If it is your first user’s password - use -c option
htpasswd -c .htpasswd username
type and confirm password
that’s all
(for other users you should ommit -c, because you not need to create .htpasswd file, simply write
htpasswd .htpasswd anotherusername
type and confirm password)
]]>Some people have problems using mailto links with Thunderbird. To fix the “choose user profile” problem, follow this howto.
THUNDERBIRD: Open with firefox an URL contained in an email
FIREFOX: open thunderbird when clicking on a “mailto:” link