Archive for the ‘PHP’ Category

PHP: Cannot find module (IP-MIB)

May 13th, 2009

 While trying to run php scripts today, i encounter the following error:

Cannot find module (IP-MIB): At line 0 in (none)
Cannot find module (IF-MIB): At line 0 in (none)
Cannot find module (TCP-MIB): At line 0 in (none)
Cannot find module (UDP-MIB): At line 0 in (none)
Cannot find module (SNMPv2-MIB): At line 0 in (none)
Cannot find module (SNMPv2-SMI): At line 0 in (none)

points to note: i installed php 5.2.9-2 using windows msi. thus, the mib files are missing.. to remedy it, go and download the binary files of php for windows. The mib files are found in the ext directory of it. copy over to extras of your main php folder and the usr folder in c:\. and it should work fine.

If running php says there is a missing dlls, open php.ini from your php folder. comment out (using ;) the dlls which are enountering problem. sometimes though, theres a spelling mistake or a mis-placement of files. just make sure that the required dlls are in ext folder of your php folder.

VN:F [1.9.6_1107]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.6_1107]
Rating: +1 (from 1 vote)
DiggTwitterTechnorati FavoritesRedditNewsVineFacebookShare

Installing PHP in Vista with Apache

May 11th, 2009

Vista, as always give lots of problems.. especially at administrator rights. One way to improve it is to off UAC (User Account Control).. but it doesnt help much either.

Anyway, installing apache in vista doesnt seem to give big problems. managed to get it off in one go..

As for php, i encountered slight problems. however, i found this site by fred sense really useful..

The part which vista always gives headache is the editing of current files in system. When i was installing, i encounter a script error which was supposed to enter the info into the httpd.conf for apache. so i had to do it manually. below are the lines for the info:

LoadModule php5_module "C:\php\php5apache2_2.dll"
AddType application/x-httpd-php .php
AcceptPathInfo on
PHPIniDir "C:\php"

Look for the DirectoryIndex line. Add ” index.php” (no quotes) to the end of that line.

One point to note is that php is installed in c:\php and apache is installed in the default directoy: C:\Program Files\Apache Software Foundation\Apache2.2.

After this, a restart in apache would give the correct result. =)

VN:F [1.9.6_1107]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.6_1107]
Rating: 0 (from 0 votes)
DiggTwitterTechnorati FavoritesRedditNewsVineFacebookShare

PHP convert date to timestamp

April 21st, 2009

Instead of finding a way to manipulate 2 date pickers and find the range of dates and use each date.

why not convert each date produced by the date picker into unix timestamp and find the range

<?

//begindate/enddate has a format of  “m d Y”

$splitbegindate = explode(‘ ‘, $begindate);
$splitenddate = explode(‘ ‘, $enddate);
$timestamp = mktime(’00′, ’00′, ’00′, $splitbegindate[0], $splitbegindate[1], $splitbegindate[2]);
$timestampend = mktime(’23′, ’59′, ’59′, $splitenddate[0], $splitenddate[1], $splitenddate[2]);

// and then do the query
$query = “Select count(*),username, SUM(time_duration),… from $table where timestamp BETWEEN $timestamp AND $timestampend group by …. “;

?>

much easier right?

VN:F [1.9.6_1107]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.6_1107]
Rating: 0 (from 0 votes)
DiggTwitterTechnorati FavoritesRedditNewsVineFacebookShare
Get Adobe Flash playerPlugin by wpburn.com wordpress themes