Home php教程 php手册 PHP安装攻略常见问题解答

PHP安装攻略常见问题解答

Jun 13, 2016 am 10:28 AM
apache php unix one but install Install common I according to Strategy module step FAQ

一、
问:我已经按步骤安装了Unix版的APACHE模块,但是我的PHP脚本源码显示在浏览器当中,或者浏览器提示我保存文件。为什么?
答: 这是由于PHP模块没有正常工作引起的。请检查下列三个地方:
请确认正在运行的APACHE执行文件是你最后编译成功的那一个。输入如下命令:
/path/to/binary/httpd -l
如果你没有看到mod_php3.c在列表中,那你就没有运行一个正确的执行文件。
请确认你已经加入了正确的"Mime Type"在你的某个.conf中。这应该像:
AddType application/x-httpd-php3 .php3
请确认上面那个"AddType"不在或块当中,否则此AddType只在当前的Virtualhost或Directory中生效。

二、
问:我已经按照说明安装了PHP,但我的PHP仍然不能和IIS一起工作,为什么?
答:必须确保需运行PHP的用户有足够的权限运行php.exe。IIS服务器使用一个在安装时创建的匿名账号,这个账号需要运行php.exe的权限。另外,任何要经过论证的用户也有权限运行php.exe.

三、
问:如何与APACHE 1.3.X一起编译PHP?
答:这很简单,只需按照如下步骤即可:
- 从APACHE站点上取得最新的APACHE分发包
- UNZIP/UNTAR文件到一个目录,例如/usr/local/src/apache-1.3.9
- 输入"./configure --with-apache=/path/to/your/apache"开始第一次编译PHP
- 顺序执行"make","make install" ,建立并复制必需的文件到APACHE的目录中
- 进入APACHE的目录中,编辑Configuration文件。在文件的尾部加入:"AddModule modules/php3/libphp3.a"
执行"./Configure","make"


  一切搞定,你已经有了一个能运行PHP的APACHE执行文件
四、
问:当我将PHP和APACHE一起编译时,好象有问题。它总是说无法找到httpd.h文件,可事实上该文件时存在的。为什么?
答:你需要让PHP配置/安装脚本知道你的APACHE源码的最高级目录,而不是包含httpd.h文件的目录。也就是说,应该指定"--with-apache=/path/to/apache/"而不是"--with-apache=/path/to/apache/src"。

五、
问:我使用RPM安装了PHP,但APACHE却不能处理PHP文件。为什么?
答: 假设你使用RPM正确安装了PHP,那你必须反注或加入下面的几行到httpd.conf文件中:
#Extra Modules
AddModule mod_php.c
AddModule mod_php3.c
AddModule mod_perlc.
#Extra Modules
LoadModule php_module modules/mod_php.so
LoadModule php3_module modules/libphp3.so
LoadModule perl_module modules/libperl.so
另外,再加入:
AddType application/x-httpd-php3 .php3
到httpd.conf的全局部分,或到你需要提供PHP支持的部分。
六、
问:在WINDOWS下如何用MAIL函数发邮件?
答:PHP在UNIX/LINUX下发邮件用的是SENDMAIL程序,在WINDOWS没有SENDMAIL,但可以用SMTP协议来完成,具体方法如下:修改PHP.INI文件的[mail function]下的SMTP。
如:
[mail function]
SMTP=public.sta.net.cn ;Win32 Only
七、
问 :php+apache在win9x下的设置一问
运行时出现:“cannot determine local host name,use servername to set it manually”
如果你有IP地址的话,只需在httpd.conf中加入:
ServerName http://你的IP
例如: ServerName http://162.105.38.100
Statement of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP and Python: Comparing Two Popular Programming Languages PHP and Python: Comparing Two Popular Programming Languages Apr 14, 2025 am 12:13 AM

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

How to set the cgi directory in apache How to set the cgi directory in apache Apr 13, 2025 pm 01:18 PM

To set up a CGI directory in Apache, you need to perform the following steps: Create a CGI directory such as "cgi-bin", and grant Apache write permissions. Add the "ScriptAlias" directive block in the Apache configuration file to map the CGI directory to the "/cgi-bin" URL. Restart Apache.

The Enduring Relevance of PHP: Is It Still Alive? The Enduring Relevance of PHP: Is It Still Alive? Apr 14, 2025 am 12:12 AM

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

How to start apache How to start apache Apr 13, 2025 pm 01:06 PM

The steps to start Apache are as follows: Install Apache (command: sudo apt-get install apache2 or download it from the official website) Start Apache (Linux: sudo systemctl start apache2; Windows: Right-click the "Apache2.4" service and select "Start") Check whether it has been started (Linux: sudo systemctl status apache2; Windows: Check the status of the "Apache2.4" service in the service manager) Enable boot automatically (optional, Linux: sudo systemctl

PHP's Purpose: Building Dynamic Websites PHP's Purpose: Building Dynamic Websites Apr 15, 2025 am 12:18 AM

PHP is used to build dynamic websites, and its core functions include: 1. Generate dynamic content and generate web pages in real time by connecting with the database; 2. Process user interaction and form submissions, verify inputs and respond to operations; 3. Manage sessions and user authentication to provide a personalized experience; 4. Optimize performance and follow best practices to improve website efficiency and security.

PHP in Action: Real-World Examples and Applications PHP in Action: Real-World Examples and Applications Apr 14, 2025 am 12:19 AM

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

How to delete more than server names of apache How to delete more than server names of apache Apr 13, 2025 pm 01:09 PM

To delete an extra ServerName directive from Apache, you can take the following steps: Identify and delete the extra ServerName directive. Restart Apache to make the changes take effect. Check the configuration file to verify changes. Test the server to make sure the problem is resolved.

PHP and Python: Code Examples and Comparison PHP and Python: Code Examples and Comparison Apr 15, 2025 am 12:07 AM

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

See all articles