


This article mainly shares with you how to configure domain name access locally in phpstudy. I hope it can help you.
1. Hosts configuration:
1. Open the hosts file with an editor, location: C:\Windows\System32\drivers\etc directory
Example:
Add the following code at the end of the hosts file:
127.0.0.1 www.tp5.com
2. apache configuration:
1 .Edit the httpd.conf file and enable the virtual host. Location: In the apache installation directory, that is, phpStudy\Apache\conf under the phpstudy installation directory, find Includeconf/extra/httpd-vhosts.conf and remove the preceding
#2. Enter the opened virtual host file httpd-vhosts.conf to configure the domain name. Location: \phpStudy\Apache\conf\extra directory
Configuration rules:
<VirtualHost *:80> ServerAdminwebmaster@dummy-host.example.com DocumentRoot"D:/phpStudy/WWW/要配置域名的项目名" ServerName 配置的域名 ErrorLog"logs/dummy-host2.example.com-error.log" CustomLog"logs/dummy-host2.example.com-access.log" common </VirtualHost>
If you want to hide the entry file index.php in the Apache configuration, even if the access address: localhost/h5.test.cn/index.php/test/index is simplified to localhost/h5.test.cn/test/index can also be achieved through domain name configuration, as follows:
<VirtualHost *:80> DocumentRoot"D:/phpStudy/WWW/h5.test.cn" ServerNamelocal.h5.test.cn <IfModuledir_module> DirectoryIndexindex.php </IfModule> </VirtualHost>
After the above configuration is completed, remember to restart the server.
Note: A problem arises at this time, that is, if you use localhost to access other local projects, you cannot access them. With so many projects, I don’t want to configure a virtual domain name for each one. It can be accessed by both domain name and localhost. I found a solution on the Internet:
Use the above method to add a domain name named localhost and bind it to the www directory, then comment out the ServerName localhost line in the httpd.conf file, restart apache, and then All can be accessed.
Related recommendations:
How to configure the domain name in wampserver
Record the process of lampp configuring the domain name directory.
Linux configuration domain name solution
The above is the detailed content of How to configure domain name access locally in phpstudy (illustrated steps). For more information, please follow other related articles on the PHP Chinese website!

PHPstudy Pro 是一款 Web 开发环境软件包,可快速部署和测试 Web 应用。安装步骤如下:从官方网站下载安装包。运行安装程序,选择安装路径和语言。安装完成后,启动 PHPstudy 并配置 PHP、MySQL、Apache 设置。验证安装,在浏览器输入“localhost”或运行命令“php -v”检查 PHP 版本。

phpstudy乱码是因为编码与译码的方式不一致,其解决办法:1、打开“控制面板”;2、打开“时钟,语言和区域”;3、点击“区域”;4、在小窗口上点击“管理”图标;5、点击“更改系统区域设置”,选择“具体的语言”,然后点击“确定”;6、重启电脑即可。

PHP Study安装失败可能是由于以下原因:1.系统兼容性问题;2.权限不够;3.文件冲突;4.网络连接异常;5.防病毒软件干扰;6.路径问题;7.系统错误。如遇问题无法解决,可通过PHP Study论坛、GitHub或官方网站寻求支持。

可以通过以下步骤修改 phpStudy 配置文件:找到配置文件(Windows:C:\Windows\phpStudy\php\php.ini;Mac:/Applications/phpStudy/php/php.ini)使用文本编辑器打开并查找要修改的设置编辑设置的值,如修改时区:date.timezone = Asia/Shanghai保存更改并重启 Apache 服务

为了更改 PHPSTUDY 端口,可通过以下步骤:打开控制面板并定位到内建 Web 服务器设置;修改端口号字段中的数字;保存更改并重启服务器;输入网站 URL 及新端口号验证更改。

通过 PHPstudy 查看数据库的方法包括:直接连接 MySQL 命令行使用 MySQL Workbench配置连接选择要查看的数据库通过 PHPMyAdmin在左侧菜单中选择要查看的数据库

本文涉及两款php的集成环境,这两款都含mysql + apache + php,phpstudy的功能比wamp要强大,并且十分简单容易上手。

无法安装 phpStudy 的解决方法:检查系统要求是否符合。禁用杀毒软件。关闭防火墙。以管理员身份运行安装程序。修复损坏的文件:sfc /scannow。尝试使用替代安装程序。联系 phpStudy 技术支持。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Chinese version
Chinese version, very easy to use

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Mac version
God-level code editing software (SublimeText3)
