[Excuse me] install and configure Apache & PHP on Ubuntu, but the file content is displayed directly.

Source: Internet
Author: User
Tags file info sapi
[Ask] install and configure Apache & PHP under Ubuntu, the file content is displayed directly I follow the method below (from http://www.kreny.com/computer/linux/apache.html) in Ubuntu804 to configure Apache and PHP are very smooth, however, after the Apache service is started, install and configure Apache & PHP in the main folder/var [consult] on Ubuntu, but the file content is directly displayed.
I configured Apache and PHP smoothly in Ubuntu804 as follows (from http://www.kreny.com/computer/linux/apache.html), but after the Apache service is started, create the file info in the main folder/var/www. php content is The PHP information table should be displayed, but the file content will be displayed in the browser. . What is the problem? how can this problem be solved?

The following installation will statically compile php into apache.
The installation process is as follows:
[Configure apache 1.3.33] --> [compile and install PHP 4.3.10] ---> [Reconfigure compile and install apache 1.3.33] --> [modify httpd. conf]
This configuration will generate libmodphp4.a Library, mod_php4.c and some related files and copy them to the src/modules/php4 directory in the Apache source program directory. Then, use -- activate-module = src/modules/php4/libphp4.a to compile Apache. The Apache compilation system generates libphp4.a and statically connects it to the httpd program. PostgreSQL support is also directly included in this httpd program, so the final result is a single httpd executable file that includes all Apache and PHP support.
-- PHP Manual --

The above installation process is summarized from the error message:
If you configure php before configuring apache, the following error results will be returned:
Configure: error: Please run Apache \'s configure or src/Configure program once and try again
Therefore, you must first configure the source of apache.
Installation process:
# Wget http://jp2.php.net/get/php-4.3.10.tar.gz/from/this/mirror
# Wget http://sunsite.tus.ac.jp/pub/apache/httpd/apache_1.3.33.tar.gz
# Tar-zxvf php-4.3.10.tar.gz
# Tar-zxvf apache_1.3.33.tar.gz
# Ls-l

Total 8340
Drwxr-xr-x 8 mysql games 4096 10 28 apache_1.3.33
Drwxr-xr-x 14 1003 1003 4096 12 15 php-4.3.10
# Cd./apache_1.3.33
#./Configure -- prefix =/usr/local/apache -- enable-module = so -- enable-module = rewrite -- enable-module = speling

Tracing ING for Apache, Version 1.3.33
+ Using installation path layout: Apache (config. layout)
Creating Makefile
Creating Configuration. apaci in src
Creating Makefile in src
+ Configured for Linux platform
+ Setting C compiler to gcc
+ Setting C pre-processor to gcc-E
+ Using "tr [a-z] [A-Z]" to uppercase
+ Checking for system header files
+ Adding selected modules
O rewrite_module uses ConfigStart/End
+ Using-lgdbm for DBM support
Enabling DBM support for mod_rewrite
+ Using system Expat
+ Using-ldl for vendor DSO support
+ Checking sizeof various data types
+ Doing sanity check on compiler and options
Creating Makefile in src/support
Creating Makefile in src/regex
Creating Makefile in src/OS/unix
Creating Makefile in src/ap
Creating Makefile in src/main
Creating Makefile in src/modules/standard
# Cd ../php-4.3.10
#./Configure -- with-mysql =/usr/local/mysql -- with-apache =/usr/src/apache_1.3.33 -- with-zlib-dir -- enable-mbstring = all

Generating files
Updating cache./config. cache
Creating./config. status
Creating php4.spec
Creating main/build-defs.h
Creating scripts/phpize
Creating scripts/php-config
Creating sapi/apache/libphp4.module
Creating sapi/cli/php.1
Creating main/php_config.h
Creating main/internal_functions.c
Creating main/internal_functions_cli.c
+ -------------------------------- +
| License: |
| This software is subject to the PHP License, available in this |
| Distribution in the file LICENSE. By continuing this installation |
| Process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| The installation process at this point. |
+ -------------------------------- +
| *** NOTE *** |
| The default for register_globals is now OFF! |
|
| If your application relies on register_globals being ON, you |
| Shocould explicitly set it to on in your php. ini file. |
| Note that you are strongly encouraged to read |

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.