0

Hi for my research, i modify the c code that makes the php ( not the code that is written with php but that which actually makes php ). I want some way of compiling it and making it work with apache.. How do i do that?

Karthick
  • 2,844
  • 4
  • 34
  • 55

2 Answers2

2

The manual is your friend:

http://www.php.net/manual/en/install.unix.apache2.php

./configure --with-apxs2=/usr/local/apache2/bin/apxs --other-options
make
make install
Wrikken
  • 69,272
  • 8
  • 97
  • 136
  • I have been trying this for quite sometime..I have been trying this for quite sometime.. I get the error "Sorry, I cannot run apxs. Possible reasons follow: 1. Perl is not installed 2. apxs was not found. Try to pass the path using --with- apxs2=/path/to/apxs 3. Apache was not built using --enable-so (the apxs usage page is displayed)" – Karthick Jun 23 '10 at 05:12
  • locate apxs returns the following results "/usr/share/doc/apache2-doc/manual/de/programs/apxs.html /usr/share/doc/apache2-doc/manual/en/programs/apxs.html /usr/share/doc/apache2-doc/manual/es/programs/apxs.html /usr/share/doc/apache2-doc/manual/fr/programs/apxs.html /usr/share/doc/apache2-doc/manual/ja/programs/apxs.html /usr/share/doc/apache2-doc/manual/ko/programs/apxs.html /usr/share/doc/apache2-doc/manual/pt-br/programs/apxs.html /usr/share/doc/apache2-doc/manual/tr/programs/apxs.html " – Karthick Jun 23 '10 at 05:16
  • Have you either build apache yourself, or installed an apache(-src/-devel) package? Have you installed Perl? – Wrikken Jun 23 '10 at 05:31
  • i did apt-get install apache2 for installing apache I have not installed perl – Karthick Jun 23 '10 at 15:15
  • Install either the devel/src/dev package of aapache (I'm not sure how it would be called in your distro), and install `perl` – Wrikken Jun 23 '10 at 17:23
  • Hey Wrikken.. I don know why.. but the latest version(php-2.3.6) of php didnt work for me.. when I tried php-2.3.5 everything was fine.. THanks – Karthick Jun 24 '10 at 17:29
1

Grab a tarball of PHP source, and untar it.

Make sure you can compile it. See the INSTALL file from the tarball. The basic process is the typical:

./configure --with-some-options...
make
make install

That you're probably familiar with if you've ever compiled software from source on linux.

Make whatever changes you'd like to the source.

Compile again, using the same steps.

timdev
  • 61,857
  • 6
  • 82
  • 92