Toon posts:

PHP _IN_ Apache compileren?

Pagina: 1
Acties:

Verwijderd

Topicstarter
Kijk... Dit is hoe ik dus altijd begrepen heb dat je apache moet compileren met PHP...
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$ gunzip -c apache_1.3.x.tar.gz | tar xf -
$ cd apache_1.3.x
$ ./configure
$ cd ..

$ gunzip -c php-4.1.x.tar.gz | tar xf -
$ cd php-4.1.x
$ ./configure ./configure --prefix=/usr --with-mysql --with-apache=../apache_1.3.x --with-gd --with-gettext=/usr --enable-safe-mode --with-config-file-path=/etc/httpd --with-exec-dir=/usr/bin --with-zlib --enable-magic-quotes --with-regex=system --with-ttf --with-db --with-gdbm --enable-mbstring --enable-mbstr-enc-trans --enable-track-vars --enable-wddx=shared --enable-mm=shared --enable-xml --enable-ftp --disable-debug --with-libdir=/usr/lib --with-db3 --with-interbase=shared --with-pgsql=shared --with-ldap --with-imap --with-curl=shared --with-pdflib=shared --with-apache=../apache_1.3.x
$ make
$ make install

$ cd ../apache_1.3.x
$ ./configure --prefix=/etc --activate-module=src/modules/php4/libphp4.a
 (The above line is correct!  Yes, we know libphp4.a does not exist at this
  stage.  It isn't supposed to.  It will be created.)
$ make
 (you should now have an httpd binary which you can copy to your Apache bin dir if
  is is your first install then you need to "make install" as well)
$ cd ../php-4.1.x
$ cp php.ini-dist /usr/local/lib/php.ini
You can edit /usr/local/lib/php.ini file to set PHP options.
Edit your httpd.conf or srm.conf file and add:
  AddType application/x-httpd-php .php

MAAR: Dan krijg je dus een .so module voor PHP... Wat ik nu gelezen heb is dat je PHP ook IN de binary van HTTPD kunt compileren zodat apache, wanneer een php iets wordt opgeroepen, niet de module hoeft te laden maar het DIRECT kan verwerken... De binary is dan wel iets groter, maar omdat je veel PHP gebruikt en dit nu ingebouwd zit is het ook SNELLER omdat ie niet steeds die module hoeft aan te spreken...

Mijn vraag is nu, HOE DOE JE DAT??
En daarbij... Hoe can in andere .c files (ook modules die je normaal met apxs erbij zet) ER-IN compileren?

Verwijderd

Die manier is de juiste hoor. Met --with-apxs bouw je een module. Alleen heb je --with-apache er 2x instaan. Let er wel op dat die naar de source directory van Apache verwijst.
Je moet nauturlijk wel je nieuwe httpd over de oude heen kopieren, of dmv make install installeren.
En ik weet het zo net nog niet of een static cgi sneller is dan de module.

Verwijderd

Topicstarter
wat moet ik nou doen? zoals het bij "code" staat? of met apxs?

Verwijderd

voor een basis static cgi, dus laat ik ff al die extra zooi weg ziet je ./configure er zo uit:

./configure --with-apache=../apache-1.3.26

--with-apache dus
--with-apxs is voor de module

  • Ronald
  • Registratie: Juli 2000
  • Laatst online: 17:40
Deze handleiding is weliswaar echt oud, maar je kunt er prima uit distileren hoe je php static in apache krijgt.

PV Output - Obdam; SolarEdge SE5K 'Voor korte strings'; 12x350Wp Oost-West 13°; 8x415Wp Zuid 10°; Totaal 7520Wp.