[ieeeeee] tagged posts

Install PHP 5.2.12 on Mac OS 10.5.8 Leopard

PHP 5.2.12 has a bug that will stop your installation:

/bin/sh /Users/kelvin/phpsource/php-5.2.12/libtool --silent --preserve-dup-deps --mode=compile gcc  ...includes redacted...  -no-cpp-precomp  -I/usr/local/php5/include -g -O2  -c /Users/kelvin/phpsource/php-5.2.12/ext/standard/dns.c -o ext/standard/dns.lo 
In file included from /usr/include/arpa/nameser.h:59,
                 from /Users/kelvin/phpsource/php-5.2.12/ext/standard/dns.c:62:
/usr/include/arpa/nameser8_compat.h:304: error: conflicting types for ‘HEADER’
/usr/include/arpa/nameser_compat.h:99: error: previous declaration of ‘HEADER’ was here
make: *** [ext/standard/dns.lo] Error 1
Trinity:~ kelvin$ 

Two header files (nameser8_compat.h & nameser_compat.h) both try to define a struct named HEADER. No can do. According to the PHP bug tracker, “NEVER ever include nameser_compat.h, it’s included in various ways in different OSes by nameser.h if needed

Doh!

So how do we go about fixing this? The easiest thing to do is to install the older PHP 5.2.11 or the HEAD from the 5.2 branch. If you are adventurous or obsessive-compulsive you can also replace these two files with the patched copies:

  1. ~/php-5.2.12/configure.innotes
  2. ~/php-5.2.12/ext/standard/dns.cnotes

Tags: , , ,

PHP makes me cry

4am: editing crufty code. lots of logic mixed up in the html old school style. Across the room a pile of three HP servers that need OSes catcalling: “I think I need a rebooty…”

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// TODO: Clean this input
//$tpar= $_GET[parent];
$tpar= intval($_GET['parent']);
// TODO: Why are we putting a date into the server array???
$SERVER['$today']= date('y-m-d');
// TODO: Why are we storing a negative integer value as a string???
$colname_res_fillContent = "-1";
if (isset($_GET['parent'])) {
// TODO: Check this input
//$colname_res_fillContent = (get_magic_quotes_gpc()) ? $_GET['parent'] : addslashes($_GET['parent']);
  $colname_res_fillContent = intval($_GET['parent']);
}
// TODO: Why are we storing a negative integer value as a string again???
$today_res_fillContent = "-1";
if (isset($SERVER['$today'])) {
    //
    // TODO: didn't we set this??? why are we doing this??? why not set the date here???
    //
  $today_res_fillContent = (get_magic_quotes_gpc()) ? $SERVER['$today'] : addslashes($SERVER['$today']);
}

Tags: , , ,