You are not logged in.

#1 2005-08-03 21:57:18

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Setting up php4

I need to run php4 for a pkg I am working with but i can't get it to work.

This is my php4 PKGBUILD:

# $Id: PKGBUILD,v 1.43 2004/07/02 21:18:08 judd Exp $
# Maintainer: dorphell <dorphell@archlinux.org>
pkgname=php
pkgver=4.3.9
pkgrel=2
pkgdesc="A high-level scripting language"
backup=(etc/php.ini)
depends=('openssl' 'libjpeg' 'freetype2' 'libpng' 'pam' 
         'gdbm' 'libxslt' 'openldap')
makedepends=('apache' 'mysql' 'imap' 'postgresql' 'bzip2' 'smtp-server')
source=(http://www.php.net/distributions/$pkgname-$pkgver.tar.gz php.ini)
url="http://www.php.net"
md5sums=('c685cb76bff996a4dff87097c43e6987' 'c17c056eee681b75c8d295608db6ce65')

build() {
  cd $startdir/src/$pkgname-$pkgver
  ./configure --with-apxs2 --prefix=/usr --sysconfdir=/etc 
    --with-ttf --enable-mailparse --with-config-file-scan-dir=/etc 
    --enable-bcmath=shared --enable-calendar=shared --enable-ftp=shared 
    --enable-gd-native-ttf --enable-magic-quotes --enable-posix=shared 
    --enable-session --enable-shared --enable-shmop=shared --with-imap 
    --enable-sysvsem=shared --enable-sysvshm=shared --enable-track-vars 
    --enable-trans-sid --enable-safe-mode --enable-sockets=shared 
    --enable-xml --with-bz2=shared --without-db2 --without-db3 
    --with-freetype-dir=/usr --with-gd --with-gdbm --enable-exif 
    --with-jpeg-dir=/usr --with-mysql=shared,/usr --with-ldap 
    --with-mysql-sock=/tmp/mysql.sock --with-openssl --with-gettext 
    --with-pear=/usr/share/pear --with-dom --with-dom-xslt 
    --with-pgsql=shared --with-pgsql-sock=/tmp/pgsql.sock 
    --with-png-dir=/usr --with-regex=system --with-zlib
  make || return 1
  mkdir -p $startdir/pkg/usr/lib/apache
#  cp config_vars.mk config_vars.old
#  sed "s|^INSTALL_IT.*$|INSTALL_IT = apxs -i -a -S LIBEXECDIR=$startdir/pkg/usr/lib/apache -n php4 libs/libphp4.so|" config_vars.old >config_vars.mk
  sed -i "s|-i -a -n php4|-i -n php4|g" Makefile
  make INSTALL_ROOT=$startdir/pkg EXTENSION_DIR=/usr/lib/php install
  cp ../php.ini $startdir/pkg/etc
}
md5sums=('c685cb76bff996a4dff87097c43e6987' 'c17c056eee681b75c8d295608db6ce65')

I followed the changes in the wiki LAMP howto - talked a ton to the guys on IRC - thanks to them but I still cannot get apache to display a php test page.

Any suggestion/help?

local/apache 2.0.54-1
    A high performance Unix-based HTTP server (with SSL)
local/mysql 4.1.13-1
    A fast SQL database server
local/php 4.3.9-2
    A high-level scripting language

Offline

#2 2005-08-04 14:49:57

Moo-Crumpus
Member
From: Hessen / Germany
Registered: 2003-12-01
Posts: 1,487

Re: Setting up php4

hm ... where do you touch apache config to tell it to use php? Should it work by just adding a php library to /usr/lib/apache?


Frumpus addict
[mu'.krum.pus], [frum.pus]

Offline

#3 2005-08-04 15:15:14

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Setting up php4

ls -l /usr/lib/apache/ | grep php

apache config:

LoadModule php4_module   lib/apache/{name from above grep output}

"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#4 2005-08-04 23:21:48

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: Setting up php4

yup, got that cactus sad

Offline

#5 2005-08-05 05:54:56

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Setting up php4

hmm. maybe it is just php_module. without the 4.
try looking in the log output and see if anything shows up..


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#6 2005-08-05 09:26:54

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: Setting up php4

the daemon fails with that LoadModule command.  My httpd.conf is here

Offline

#7 2005-08-05 14:16:13

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Setting up php4

try taking the addhandler out of the if bracket.

<IfModule mod_php4.c>
  DirectoryIndex index.php index.html
  AddType application/x-httpd-php .php
  AddType application/x-httpd-php-source .phps
</IfModule>

becomes

  DirectoryIndex index.php index.html
  AddType application/x-httpd-php .php
  AddType application/x-httpd-php-source .phps

I am not sure if mod_php4.c is what is needed there or not.
*shrug*

Also, are you sure php is working right? try a `php -v` to have it output the version. This should report any errors in the php.ini file if there are any.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#8 2005-08-05 14:32:14

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: Setting up php4

OK - php was working fine - I tried `php index.php` the other day and that was fine.

Tried taking the addhandler out of the bracket and hey presto - it works big_smile

I knew you'd know cactus big_smile

BUT - when I actually try to run the module i set php up to run I get:

Warning: dl(): (null): Unable to initialize module Module compiled with module API=20041030, debug=0, thread-safety=0 PHP compiled with module API=20020429, debug=0, thread-safety=0 These options need to match in /home/httpd/html/test.php on line 2

Offline

#9 2005-08-05 14:51:11

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Setting up php4

Well, it looks like a discrepancy in module api. Strange.
What module are you trying to use? Did you compile the module with the version of php you are using?

`php -m` will output the modules that php is set to use (basically what is listed in php.ini)
`php -i` will show you what php knows about its environment (ie..a phpinfo() call)


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#10 2005-08-05 14:56:45

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: Setting up php4

Well, it's from a gis pkg - do I have to list it in php.ini?  I have not done that.  I did build it against this version of php - at least i think I did!

I obviously neglected to make clean at some point and the module was built againsts the old php - all good now and the pkg is set to depend only on that version.

Cheers, cactus wink

Offline

#11 2005-08-05 17:12:30

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Setting up php4

w00t!
glad I could help, Mr thewrecker

wink


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

Board footer

Powered by FluxBB