Grab MAC From ARP Table With PHP

Cool function you can use on your local network to lookup a devices MAC address, (assuming the device is on your network), using PHP.For a big company, either look in the remote locations router, or your core router. // ============================================= // getmac(Device IP, Router, SNMP Read Community) // Michael Requeny -- http:…

Get base directory of current script

if (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] === 'off') { $protocol = 'http://'; } else { $protocol = 'https://'; } $base_url = $protocol . $_SERVER['SERVER_NAME'] . dirname($_SERVER['PHP_SELF']);…

BigSmoke » Executing system commands from PHP with SUID executable.

If you want to execute system commands from something like PHP, you need a SUID executable which you can call from your PHP scripts. This is such a script. It could be extended to support parameters for the commands you want to execute, but that would be an enormous security…

PHP 5.3 and “It is not safe to rely on the system’s timezone settings”

PHP 5.3 now requires that you either have a timezone set in your php.ini file or that you pass the desired timezone via the date_default_timezone_set() function before calling the date() function. I opened my server’s /etc/php.ini file and searched for timezone. My…

Upgrade PHP 5.1/5.2 to 5.3 on CentOS

Since I couldn’t just install the php53 packages as they would conflict with the php packages, I had to remove all the existing PHP packages and install the new ones. This meant that I had to take stock of exactly what packages I had to remove and replace. I…