"Ask" To install the configuration apache&php on Ubuntu, the contents of the file are displayed directly

Source: Internet
Author: User
Tags file info sapi
"Ask" in Ubuntu installed configuration apache&php, the contents of the file is displayed directly
i configured Apache and PHP in Ubuntu804 as follows (from http://www.kreny.com/computer/linux/apache.html), but after starting the Apache service, in the home folder/ var/www/new file info.php content is , it should be said that the PHP information form should be displayed, but the browser will display the contents of the file . Excuse me, what is this problem and how to solve it?

The following installation will statically compile PHP into Apache.
The installation process is:
[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 libraries, mod_php4.c and some related files and copy them to the SRC/MODULES/PHP4 directory in the Apache source program directory. Then compiling the Apache,apache with--activate-module=src/modules/php4/libphp4.a will generate libphp4.a and statically connect it to the HTTPD program. PostgreSQL support is also included directly in the HTTPD program, so the end result is a single httpd executable file that includes all Apache and PHP support.
--"PHP Handbook"--

Summarize the above installation process from the error message:
Before configuring Apache, you will have the following error results if you first configure PHP:
Configure:error:Please Run apache\ ' s configure or Src/configure program once and try again
Therefore, the first thing to configure the Apache source is a bit.
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 01:47 apache_1.3.33
Drwxr-xr-x 1003 1003 4096 02:55 php-4.3.10
# CD./apache_1.3.33
#./configure--prefix=/usr/local/apache--enable-module=so--enable-module=rewrite--enable-module=speling

configuring 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 was subject to the PHP License, available in this |
| Distribution in the file LICENSE. By continuing this installation |
| Process, you is bound by the terms of this License agreement. |
| If you don't agree with the terms of this license, you must abort |
| The installation process at this point. |
+--------------------------------+
| NOTE * * * |
| The default for register_globals are now off! |
| |
| If your application relies on register_globals being on, you |
| Should explicitly set it to on your php.ini file. |
| Note that is 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.