search
HomeBackend DevelopmentPHP ProblemHow to configure php server

How to configure php server

Nov 04, 2020 am 10:19 AM
phpserver

配置php服务器的方法:1、设置根目录、域名和目录权限;2、更改默认首页;3、更改监听端口,如80端口;4、配置虚拟主机,指定虚拟目录路径。

How to configure php server

服务器配置

(视频教程推荐:java视频教程

1、虚拟目录配置

<VirtualHost _default_:80>
#设置根目录
DocumentRoot "G:\\phpStudy\\PHPTutorial\\phpMyAdmin"
#设置域名
 ServerName www.phpmyadmin.com
 #目录权限
  <Directory "G:\\phpStudy\\PHPTutorial\\phpMyAdmin">
   #允许将目录结构用索引的方式展示
    Options +Indexes +FollowSymLinks +ExecCGI
    #允许覆盖;,用来做分布式部署
    AllowOverride All
    #执行顺序,先允许,后拒绝
    Order allow,deny
    #允许所有请求
    Allow from all
    Require all granted 
  </Directory>
  </VirtualHost>

更改默认首页

<IfModule dir_module>
    DirectoryIndex index.html index.php index.htm l.php
</IfModule>

更改监听端口

Listen 80

2、虚拟主机配置

<VirtualHost _default_:80>
  DocumentRoot "C:\\web1"       #指定虚拟目录路径
  ServerName www.baidu.com     # 虚拟目录绑定的域名
  DirectoryIndex aa.php        # 默认首页
  <Directory "C:\\web1">
    Options -Indexes -FollowSymLinks +ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
    Require all granted
  </Directory>
</VirtualHost>

相关推荐:php培训

The above is the detailed content of How to configure php server. For more information, please follow other related articles on the PHP Chinese website!

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

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

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.