Home  >  Article  >  Backend Development  >  Installation documentation for Apache+PHP4.0+Sybase on Linux_PHP tutorial

Installation documentation for Apache+PHP4.0+Sybase on Linux_PHP tutorial

WBOY
WBOYOriginal
2016-07-15 13:24:18761browse

[Purpose]

Use Linux to build a web server and connect to the Sybase database on a minicomputer. We installed an experimental database on the Sybase server. The database name is test. There is a table in test called Province, and the fields include Province_id and Province.

Province_id Province
---------- --------
110 Beijing City
120 Tianjin City

[Related software]

Redhat 7.0 Linux
Apache 1.3.12
PHP 4.0.0
Sybase 11.9.2 for Linux /Intel

[Installation Process]

1. Install Red Hat 7.0

I chose Customer full installation because when installing Sybase, an X environment is required.

After the installation is completed, create a working directory /home/workshop and upload all installation files

sybase-common-11.9.2-3.i386.rpm
sybase-openclient-11.1 .1-3.i386.rpm
apache_1.3.12.tar.gz
php-4.0.0.tar.gz

2. Install Sybase’s open-client.

In the /home/workshop directory:

host_name# rpm -hiv sybase-common-11.9.2-3.i386.rpm
host_name# rpm -hiv sybase-openclient -11.1.1-3.i386.rpm

The default installation path is /opt/sybase-11.9.2/, and if you have a sybase user, use the passwd sybase command to change the password of the sybase user.

Now, use sybase to log in to your Linux computer, the computer will display

C-Shell users: <br>source .cshrc <br>=> Start 'srvbuild' <br>srvbuild <br>Documentation towards any Sybase product can be found on our Dynaweb <br>pages accessible from our World Wide Web site: <br>We would like you to register your installation and find more <br>information about this Sybase Adaptive Server Enterprise release <br>for Linux available from: <br>Enjoy this Sybase Adaptive Enterprise Server installation ! <br>bash-2.04$ 

At this time, start the Xwindow environment,

bash -2.04$startx

In the Xwindow environment, run /opt/sybase-11.9.2/bin/dsedit, select Add New Server Entry,

Server Name: devhost (you can write it as you like)
Choose add new network transport,
transport type: TCP
host name: 211.5.6.50 (server’s ip)
port Number: 5000 (Sybase server listening port)

When finished, confirm to exit.

You can use isql command to check whether the connection is successful,

bash-2.04$isql -Usa -Sdevhost, after entering the password,
1> use test
2> go
1> select * from test.Province
2> go
Province_id Province
----------- --------
110 Beijing City
120 Tianjin City
130 Hebei Province
140 Shanxi Province
150 Inner Mongolia
210 Liaoning Province
220 Jilin Province
230 Heilongjiang
... ...
610 Shaanxi Province
620 Gansu Province
630 Qinghai Province
640 Ningxia District
650 Xinjiang District
660 Tibet District
(28 rows affected)
1>
Now Openclient installation is complete.

3. Install Apache and PHP4

host_name/home/workshop# tar -vzxf apache_1.3.12.tar.gz
host_name/home/workshop# tar -vzxf php-4.0.0.tar.gz

Enter the apache directory, precompile apache

# ./configure --prefix=/home/apache

We put Apache is installed in the /home directory.

Enter the php directory and compile php + sybase

#cd ../php-4.0.0
# ./configure --with-apache=../apache_1.3.12
--with-mysl=no
--with-sybase-ct=/opt/sybase-11.9.2/
--enable-ftp
--enable-track-vars

# make ; make install
# cp php.ini-dist /usr/local/lib/php.ini
# cd ../apache_1.3.12
# ./configure --prefix= /home/apache --activate-module=src/modules/php4/libphp4.a
# make ; make install

The compilation work has been completed, and now some configuration files need to be modified.

#cd /home/apache/conf
#vi httpd.conf

Modify DirectoryIndex index.html index.php3 index.php line

Change AddType application Remove the # in front of the line /x-httpd-php .php

and add a line AddType application/x-httpd-php .php3

Finally, you still need to modify a few parameters

ServerName
ServerAdmin
DocumentRoot "/home/apache/htdocs"

Start Apache

cd ../bin
./apachectl start

Now, we need to write a file to make apache start when the computer starts.

and you will edit /etc/rc.d/rc.sysinit , add auto_run file at the last line.
auto_run will be created at /usr/sbin and with +x mode.

auto_run is:
#!/bin/sh
/home/apache/bin/apachectl restart

The installation is partially completed.

【Related articles】


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/446783.htmlTechArticle[Purpose] Use Linux to build a web server and connect to the Sybase database on a minicomputer. We installed an experimental database on the Sybase server. The database name is test. There is a...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn