Home Database Mysql Tutorial 配置最新的PHP加MYSQL服务器完全版_MySQL

配置最新的PHP加MYSQL服务器完全版_MySQL

Jun 01, 2016 pm 02:12 PM
php Revise Install up to date server Configuration


  通过一个小时的研究和设置.实现了最新的 PHP 5.0 + MYSQL 5.0 + WIN2003.
  个人认为还是有必要写个教程出来.因为很多方面和老版本的不尽相同.
  说实话自己也是查阅了很多官方文档才解决了很多怪异问题.
  
  MYSQL 5.0 FOR WINDOWS
  PHP 5.0 FOR WINDOWS
  PHPMYADMIN
  WINDOWS SERVER 2003
  
  首先安装 MYSQL .本来以为新版本的安装界面应该会花哨点.
  但是仍然只看到老土的海豚.除了安装时间比 4.0 长.当然咯.因为 5.0 比 4.0 体积大很多.
  
  推荐安装在独立的 NTFS 分区上.比如我服务器的 F盘.只放服务器软件.
  路径为: F:\MYSQL
  然后进入 F:\MYSQL\BIN\ 鼠标双点 winmysqladmin.exe
  首次运行会提示输入超级用户和密码.就输入 root 密码 root
  注意啊.如果是对外服务器请设置超级复杂.比如 Wjwsfjn29szjwh~mysql
  翻译过来就是: 我叫魏舒芬.今年29岁至今未婚.
  
  到这里.MYSQL就安装完毕了.如果不明白请参看深空同学的相关文章.
  
  下面安装 PHP 5.0 其实没什么安装不安装的.解压缩文件.推荐放到路径为: F:\PHP
  到这里就应该进入关键步骤了.
  首先复制 PHP 目录下的 Php.ini-dist 到 C:\Windows\ 并将文件名修改成为 Php.ini
  
  COPY F:\PHP\Php.ini-dist C:\Windows
  Ren Php.ini-dist Php.ini
  
  如果是 WINDOWS 2000 就是: C:\WINNT如果是 WIN9X / 2003 就是: C:\Windows
  然后复制 PHP 目录下 DLLS 目录里的所有文件到 SYSTEM32 目录.
  
  COPY F:\PHP\dlls\*.* C:\Windows\System32
  如果是 WINDOWS 2000 就是: C:\WINNT\System32如果是 WIN9X / 2003 就是: C:\Windows\System32
  继续.复制PHP目录下 php4ts.dll 文件到 System32 目录里.
  
  COPY F:\PHP\php4ts.dll C:\Windows\System32
  到这里复制工作全部完成.下面修改 C:\Windows\Php.ini 文件.
  
  请注意.5.0的版本修改与4.0并不完全相同.需要注意的如下.
  
  查找 extension_dir 字串.修改为你 PHP 目录里 extensions 的路径.
  
  ; Directory in which the loadable extensions (modules) reside.
  extension_dir = F:\PHP\extensions
  
  然后与 PHP 4.0 不同的是.需要修改 Php.ini 文件里的如下内容:
  查找 cgi.force_redirect 字串.默认值为1.将其修改为0.并取消前面的;号.
  
  即:
  
  ; cgi.force_redirect is necessary to provide security running PHP as a CGI under
  ; most web servers. Left undefined, PHP turns this on by default. You can
  ; turn it off here AT YOUR OWN RISK
  ; **You CAN safely turn this off for IIS, in fact, you MUST.**
  cgi.force_redirect = 0
  
  切记如上修改的地方.否则PHP 5.0是无法运行的.会有如下提示.
  
  Security Alert! The PHP CGI cannot be accessed directly.
  
  相关官方技术资料:
  
  !NOTE!: Since 4.1.2, the php.ini setting cgi.force_redirect defaults to '1' which effectively prevents the cgi from working within IIS. You need to set
  up at least a minimal php.ini file with the following directive:
  
  cgi.force_redirect = 0
  
  If it doesn't work immidiately, make sure you have the php.ini file in the
  right place (%SYSTEMROOT%\php.ini).
  
  接下来修改 Php.ini 文件关于 MYSQL 5.0 的设置.
  
  查找 [MySQL] 字段内的内容.修改如下.
  
  mysql.default_port = 3306
  // 这里是MYSQL的端口.
  
  mysql.default_host = localhost
  // 这里是本地主机.
  
  mysql.default_user = root
  // 这里是用户
  
  mysql.default_password = Wjwsfjn29szjwh~mysql
  // 这里是密码
  
  修改到这里就可以让 Php 与 MYSQL 关联了.
  最后启动 PHP 对 MYSQL 模块支持.
  
  查找 extension=php_mysql.dll 字串.删除掉前面的 ; 号
  
  extension=php_mysql.dll
  
  请注意.如果不启动 PHP 对 MYSQL 模块支持.将无法使 PHPMYADMIN 正常工作.将提示:
  
  cannot load MySQL extension, please check PHP Configuration
  无法装入 MySQL 扩展,请检查 PHP 的配置。
  
  相关官方技术资料:
  
  To connect to a MySQL server, PHP needs a set of MySQL functions called "MySQL extension".
  This extension may be part of the PHP distribution (compiled-in), otherwise it needs to be loaded dynamically.
  Its name is probably mysql.so or php_mysql.dll. phpMyAdmin tried to load the extension but failed.
  
  到这里应该就没有很大问题了.如果有配置基础的朋友应该完全可以理解了.
  本人在实际配置的时候也遇到了很多问题.最后都是耐心查询官方文档得到了解决.
  
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 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

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

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

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

Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

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,

PHP Program to Count Vowels in a String PHP Program to Count Vowels in a String Feb 07, 2025 pm 12:12 PM

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

How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

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

Explain late static binding in PHP (static::). Explain late static binding in PHP (static::). Apr 03, 2025 am 12:04 AM

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? Apr 03, 2025 am 12:03 AM

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

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.

See all articles