学习php前需要了解的知识,学习php知识
学习php前需要了解的知识,学习php知识
1.静态网站与动态网站
A)静态网站:
不支持数据交互的网站(后缀: .html .htm)
B)动态网站:
支持数据交互的网站,动态网站可以放静态网页的
i.实现动态网站的技术
1.Asp .asp
2.php .php
3. .net .aspx
4.Java .jsp
2.客户端与服务器端
A)客户端:浏览者使用的计算机
B)服务器端:存放网站代码的机器
C)客户端给服务器发送一个请求,(HTTP请求),服务器会把静态资源(html、代码、图片、js、CSS)发送到客户端(HTTP响应),客户端通过浏览器解析返回的代码,就形成了我们看到的页面。
3.端口和端口号
A)端口就是服务运行的入口,类似于大楼的门
B)端口号:门的门牌号。范围为0~65535
C)如何查询端口号是否被利用。
Win+R后输入cmd进入命令行
输入netstat -ano
D)80端口一般留给WEB服务器用,21端口留给FTP用,25端口留给邮件服务器用。
4.BS和CS架构
A)BS架构
B:brower 浏览器
S:sever 服务器
通过浏览器访问服务器
B)CS架构
C:client 客户端
S:sever 服务器
通过一个客户端软件访问服务器
例:qq、炒股软件
5.前台和后台
A)前台:浏览器看到的界面
B)后台:管理员操作的界面,后台用来操作前台的数据
6.站点、虚拟目录、虚拟主机
A)站点:存放网站内容的文件夹
B)虚拟目录:有权限的文件夹
C)虚拟主机:有权限的文件夹+域名+端口
7.更改虚拟目录
因为PHP的运行需要apache的支持,所以php的目录要告知apache,在apache大的配置文件中配置php的虚拟目录
打开apache的配置文件,搜索documentroot(配置文件中是不区分大小写的)
在浏览器地址栏中输入http://localhost/text.php(修改后的虚拟目录),发现无法打开指定页面的原因:没有给更改的目录设置访问权限
解决:在apache配置文件中,将指定文件夹的权限设定为 allow from all
更改方法:
1.找到wampwerver\bin\apache\apache2.4.9\conf\下的http.conf,打开后,输入vhosts 进行查找,找到下图所在的地方,去掉前面的#
2.找到wampserver/bin/apache/apache2.4.9/conf/extra下面的httpd-vhosts.conf,打开并在文本的最后添加如下代码
DocumentRoot "D:/wamp/www/web1/"
DirectoryIndex wo.php
ServerName www.sina.com
3.修改C:/WINDOWS/system32/drivers/etc/host这个文件,用记事本打开,加上如下内容:
127.0.0.1 www.sina.com
注释:D:/wamp/www/web1/ 是网站项目的根目录
7.更改主页
在apache的配置文件中查找directoryindex,这个指令是设置网站首页。
9.更改监听端口
Listen
浏览器请求的格式:http://网址[:端口号]/php页面
如果是端口号80,那么端口号可以省略。
10.DNS解析
A)DNS:域名解析系统。浏览器输入域名,先到最近的DNS服务器上解析出域名对应的 IP地址(最近的DNS解析服务器就是本机),再通过IP地址去访问服务器。
本机的DNS解析数据库在“C:\Windows\System32\drivers\etc\hosts”
11.PHP语法的特点
PHP的关键字不区分大小写,变量名区分大小写

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

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

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

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

Hot Topics



PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

To work on file upload we are going to use the form helper. Here, is an example for file upload.

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

CakePHP is an open source MVC framework. It makes developing, deploying and maintaining applications much easier. CakePHP has a number of libraries to reduce the overload of most common tasks.

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,
