Products and Services Support Training Documentation Partner Programs About Red
Hat
  download storecart
red hat logo
redhat.comredhat network

Red Hat Documentation

CCVS Administration Guide: PHP3 Installation

CCVS Administrator's Guide
Building the CCVS PHP3 Interface

Version 3.3


Revised February 15, 2025
Red Hat, Inc.
2600 Meridian Pkwy
Durham, NC 27713
919-547-0012


Back to main Documentation page
Back to Administrator's Guide
 

Table of Contents

Overview
Finding the Source Code
Preparing to Build
Creating the Makefile
Building the Software
Troubleshooting
Building CCVS in PHP4
Using CCVS in PHP
 

Overview

The CCVS PHP3 interface must be built after CCVS has been installed. It depends on exactly how you have installed and configured PHP3 at your site, so it can't be pre-built.

Finding the Source Code

The source code for our PHP3 interface is in src/php3 under the directory in which you installed CCVS. So, if you used the default location, it would be /usr/local/ccvs/src/php3. The actual module source code is in "cvphp.c", and the script "cvphpconfig.pl" can help you build the software on some systems.

Preparing to Build

There are a few things you'll need to know before you start.

First, you'll need to know where three PHP3 header files are located. They are php.h, phpdl.h, and config.h. Note that if you've installed both the Apache and CGI versions of PHP3, they will have different config.h files, and you would need to build the module twice in order for it to be available in both configurations.

Second, you'll need to know if you will need to link against any PHP3 library, and where that library is if so. On our systems, we've needed to link against the PHP3 library in order to use the Apache version of PHP3, but not for the CGI version. Look for a file with "libphp" in its name.

Third, you'll need to know if there are any additional libraries you might need to get PHP3 to work on your system. For example, on a SCO system, you might need to link in the socket library in order to make network calls.

Fourth, you'll need to know where to install the resulting file in order for PHP3 to locate it.

Creating the Makefile

We've included a Perl script that can help create the Makefile if you know the answers to the questions above. Type "perl cvphpconfig.pl" in order to run it. It will then prompt you with some questions. A sample session with this script is included here.
Script started on Tue Apr 27 09:44:32 1999
chuck:~/src/cvphp$ perl cvphpconfig.pl
In what directory is your php.h file? /usr/include/php3
In what directory is your phpdl.h file? /usr/include/php3/dl
In what directory is your PHP3 config.h file? /usr/include/php3/cgi
Sometimes, you need to link in a PHP3 library. This is often
the case if you're using the PHP3 Apache module, for example.
Do you need to link in the PHP3 library? n
Sometimes, you need to link against additional libraries. For
example, on SCO you may need to link against the socket library.
Do you need to link against any other libraries? n
Where do you want to install the PHP3 module? /usr/lib/php3/cgi
Writing Makefile...done.
chuck:~/src/cvphp$ exit
Script done on Tue Apr 27 09:45:06 1999

After running this script, you'll have a Makefile geared for a Linux-based system. Here's the ouptut from our sample run.

# Makefile generated by cvphpconfig.pl
# The following is good for GCC on most ELF binutil systems.
INCLUDES=-I/usr/local/ccvs/include -I/usr/include/php3 -I/usr/include/php3/dl -I/usr/include/php3/cgi
LIBS=-L/usr/local/ccvs/lib/ -lccvs -lc
CFLAGS=-fPIC $(INCLUDES) -DCOMPILE_DL
install: cvphp.so
	cp cvphp.so /usr/lib/php3/cgi
cvphp.so: cvphp.o
	$(CC) $(CFLAGS) -shared -Wl,-soname,cvphp.so -o cvphp.so cvphp.o $(LIBS)
cvphp.o: cvphp.c
	$(CC) $(CFLAGS) -c -o cvphp.o cvphp.c

There are two parts that might have to be changed for non-Linux systems. First, the "CFLAGS" line must instruct the compiler to produce code that can be dynamically loaded. This Makefile includes GCC's directive for producing position independent code, "-fPIC". Second, the linker line must actually produce a shared library for the target system. If you need to change these, you can edit the Makefile produced by the script.

Building the Software

Once you've got a Makefile you believe will work, you can type "make cvphp.so" to build the shared library. You will then need to make sure you can write to the directory where the file must be installed (via "su" for example), and type "make install". Once this has been done, you should be able to put the command "dl(cvphp.so)" in your PHP3 scripts in order to enable the CCVS extensions to PHP3.

Troubleshooting

If your web server is unable to load the CCVS PHP module, the first thing to check is whether the web server can load any PHP module.

PHP comes with a "calendar" module. Try setting up a web page that loads and uses it. If that fails, the problem is likely to be with your PHP setup. If you resolve it, and load the calendar module successfully, you will probably be able to load CCVS as well.

Building CCVS in PHP4

We have not fully tested the CCVS PHP module under PHP4. However, users have reported that it can be made to work.

To build the module under PHP4, you will have to change the reference to "config.h" in cvphpconfig.pl to "php_config.h". After running the script, modify the Makefile it generates to look for the header files in the correct locations.

Using CCVS in PHP

See the PHP3 Language API. (This also applies to PHP4.)
  <.php3>

 

 


 
© 2001 Red Hat, Inc. All rights reserved.
About Red Hat  :  Legal statement  :  Privacy statement  :  Y2K statement  :  Contact Red Hat