php教程 php手册 PHP安装步骤(以apache 2.2 + php5.3为例)

PHP安装步骤(以apache 2.2 + php5.3为例)

Jun 06, 2016 pm 07:59 PM
apache php 설치하다 단계

1. Download Apache for windows MSIfile, and run it Bydefault, port is 80, root dir is %apache_dir%/htdocs. You can update thesettings in conf/httpd.conf file 2. If Apache Service can't be installed in Control Panel Admin Tools Services, Ex

1.     Download Apache for windows MSIfile, and run it

Bydefault, port is 80, root dir is %apache_dir%/htdocs. You can update thesettings in conf/httpd.conf file

2.  If Apache Service can't be installed in "Control Panel > Admin Tools > Services",

        Execute following command in %apache_dir%/bin

           httpd.exe -k install -n Apache2.2

      另外几个有用的命令:

    remove apache service:      httpd.exe -k uninstall -n Apache2.2

            start apache service from : httpd.exe -k start

            stop apache service:           httpd.exe -k stop    orhttpd.exe -k shutdown

            restart apache service:       <span>httpd.exe -k restart</span>

 

      如果不通过windows Apache service,你可以直接使用下列命令:

            start apache server:          httpd

            stop apache server:       <span>httpd.exe -k shutdown</span>     

            restart apache server:       <span>httpd.exe -k restart</span>

 


2.     Test if apache server works

1)     Start server: start “Apacheservice” from “Control Panel > select “Start > Programs > Apache httpserver 2 > control apache server > start” or start server from apacheserver icon in the right bottom corner of desktop

For Win 7,上述方法都无法启动apache server,你需要rightclick右下角的apache icon,然后select “open services”,然后start“apache server” service

2)     Try to accesshttp://localhost

 

3.     Download and extract php5.3 zipfile

Note: download php 5.3 VC9 thread safe version

 

4.     进入 php的安装目录,将php.ini-productionphp.ini-development复制一份,命名为 php.ini

 

Assume php install dir is “d:/php5”

5.     Configure PHP in php.ini file

1)     Find

extension_dir = "./"

            Change it to following

                        extension_dir = "d:/php5/ext"

IF there is "#" before above code, MUST REMOVE IT!!!!!!!!!!!!!!

            php can’tfind extension module without it

2)     To support mysql, remove “;”fromfollowing line

;extension=php_mysql.dll

if php load mysql module successfully, you can see "mysql" module (NOT "mysqlnd" module) in phpinfo()


To Support openssl, remove ";" from following line (phplist with gmail setting must use openssl)

;extension=php_openssl.dll

if php load mysql module successfully, you can see "openssl" module in phpinfo()


3)     (Optional)To enable short open tags(for example ...?>), find “short_open_tag”setting and change it tofollowing:

short_open_tag = On

4)     (Optional)To display errormessages in your browser window for development, find “display_errors”settingand change it to following:

display_errors = On

 

6.     Configure Apache for PHP 5

Open%apache_dir%/conf/httpd.conf file,

 

1)     Add php module

If usingApache 2.0.x, add following line after all the LoadModule statements:

           LoadModulephp5_module "d:/php5/php5apache2.dll"

 

If usingApache 2.2.x, add the following line instead:

           LoadModulephp5_module "d:/php5/php5apache2_2.dll"

 

注意:使用的是“/”,而不是“/”

 

2)     Add php type

Searchfor "AddType" in the file, and add the following line after the last"AddType" statement

            AddTypeapplication/x-httpd-php .php

            AddTypeapplication/x-httpd-php .phtml

 

3)     Indicate the location folder ofyour PHP ini file

Add the following line to the end of your httpd.conf file.

            PHPIniDir"d:/php5"

注意:使用的是“/”,而不是“/”

 

4)     Find “DirectoryIndex” setting,and change it to

DirectoryIndex index.php index.html

 

5)     Save httpd.conf file and restartapache server

 

7.     Create a test.php file in rootpath, the content is following:

Tryit fromhttp://localhost/test.php

 

注意:不再需要在环境变量“path”里添加php的安装目录

 

 

 

 

본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

Video Face Swap

Video Face Swap

완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

인기 기사

<gum> : Bubble Gum Simulator Infinity- 로얄 키를 얻고 사용하는 방법
3 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌
Mandragora : 마녀 트리의 속삭임 - Grappling Hook 잠금 해제 방법
3 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌
Nordhold : Fusion System, 설명
3 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌

뜨거운 도구

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

SublimeText3 Mac 버전

SublimeText3 Mac 버전

신 수준의 코드 편집 소프트웨어(SublimeText3)

PHP와 Python : 다른 패러다임이 설명되었습니다 PHP와 Python : 다른 패러다임이 설명되었습니다 Apr 18, 2025 am 12:26 AM

PHP는 주로 절차 적 프로그래밍이지만 객체 지향 프로그래밍 (OOP)도 지원합니다. Python은 OOP, 기능 및 절차 프로그래밍을 포함한 다양한 패러다임을 지원합니다. PHP는 웹 개발에 적합하며 Python은 데이터 분석 및 기계 학습과 같은 다양한 응용 프로그램에 적합합니다.

PHP의 지속적인 사용 : 지구력의 이유 PHP의 지속적인 사용 : 지구력의 이유 Apr 19, 2025 am 12:23 AM

여전히 인기있는 것은 사용 편의성, 유연성 및 강력한 생태계입니다. 1) 사용 편의성과 간단한 구문은 초보자에게 첫 번째 선택입니다. 2) 웹 개발, HTTP 요청 및 데이터베이스와의 우수한 상호 작용과 밀접하게 통합되었습니다. 3) 거대한 생태계는 풍부한 도구와 라이브러리를 제공합니다. 4) 활성 커뮤니티와 오픈 소스 자연은 새로운 요구와 기술 동향에 맞게 조정됩니다.

IIS 및 PHP의 호환성 : 깊은 다이빙 IIS 및 PHP의 호환성 : 깊은 다이빙 Apr 22, 2025 am 12:01 AM

IIS 및 PHP는 호환 가능하며 FastCGI를 통해 구현됩니다. 1. IIS 구성 파일을 통해 .php 파일 요청을 FastCGI 모듈로 전달합니다. 2. FASTCGI 모듈은 PHP 프로세스를 시작하여 요청을 처리하여 성능과 안정성을 향상시킵니다. 3. 실제 응용 프로그램에서는 구성 세부 사항, 오류 디버깅 및 성능 최적화에주의를 기울여야합니다.

session_start ()가 여러 번 호출되면 어떻게됩니까? session_start ()가 여러 번 호출되면 어떻게됩니까? Apr 25, 2025 am 12:06 AM

Session_Start ()로 여러 통화를하면 경고 메시지와 가능한 데이터 덮어 쓰기가 발생합니다. 1) PHP는 세션이 시작되었다는 경고를 발행합니다. 2) 세션 데이터의 예상치 못한 덮어 쓰기를 유발할 수 있습니다. 3) Session_status ()를 사용하여 반복 통화를 피하기 위해 세션 상태를 확인하십시오.

Nginx 및 Apache : 주요 차이점 이해 Nginx 및 Apache : 주요 차이점 이해 Apr 26, 2025 am 12:01 AM

Nginx와 Apache는 각각 고유 한 장점과 단점이 있으며 선택은 특정 요구에 기초해야합니다. 1.NGINX는 비동기 비 블로킹 아키텍처로 인해 높은 동시 시나리오에 적합합니다. 2. Apache는 모듈 식 설계로 인해 복잡한 구성이 필요한 저소성 시나리오에 적합합니다.

Laravel 사용 : PHP로 웹 개발을 간소화합니다 Laravel 사용 : PHP로 웹 개발을 간소화합니다 Apr 19, 2025 am 12:18 AM

Laravel은 다음을 포함하여 웹 개발 프로세스를 최적화합니다. 1. 라우팅 시스템을 사용하여 URL 구조를 관리합니다. 2. 블레이드 템플릿 엔진을 사용하여보기 개발을 단순화하십시오. 3. 대기열을 통해 시간이 많이 걸리는 작업을 처리합니다. 4. eloquentorm을 사용하여 데이터베이스 작업을 단순화하십시오. 5. 모범 사례를 따라 코드 품질과 유지 관리를 향상시킵니다.

작곡가 : AI를 통한 PHP 개발 지원 작곡가 : AI를 통한 PHP 개발 지원 Apr 29, 2025 am 12:27 AM

AI는 작곡가 사용을 최적화하는 데 도움이 될 수 있습니다. 특정 방법에는 다음이 포함됩니다. 1. 종속성 관리 최적화 : AI는 종속성을 분석하고 최상의 버전 조합을 권장하며 충돌을 줄입니다. 2. 자동화 된 코드 생성 : AI는 모범 사례를 준수하는 composer.json 파일을 생성합니다. 3. 코드 품질 향상 : AI는 잠재적 인 문제를 감지하고 최적화 제안을 제공하며 코드 품질을 향상시킵니다. 이러한 방법은 기계 학습 및 자연어 처리 기술을 통해 구현되어 개발자가 효율성과 코드 품질을 향상시킬 수 있도록 도와줍니다.

session_start () 함수의 중요성은 무엇입니까? session_start () 함수의 중요성은 무엇입니까? May 03, 2025 am 12:18 AM

session_start () iscrucialinphpformanagingUsersessions.1) itiniteSanewsessionifnoneexists, 2) ResumesAnxistessions, and3) setSasessionCookieForContInuityAcrosrequests, enablingplicationsirecationSerauthenticationAndpersonalizestContent.

See all articles