PHP的安装,开发环境的搭建
近日对PHP产生了浓厚的兴趣,遂决定学习一下。首先是安装。
第一步,安装Apache
从apache下载Apache2.2安装包,安装,运行,浏览器输入地址127.0.0.1:8080,出现“It Works!”,安装成功。
第二步,安装PHP5
从cn2.php.net下载windows安装包,运行安装,看到选择扩展的界面,想当然的全部选择,安装OK。再运行Apache,报错,缺少DLL,不能启动PHP。看来扩展不是随便选择的,再次运行安装程序,取消所有扩展,再次运行Apache,OK。写一个页面,加入,浏览器打开,It‘s OK。
安装phpmyadmin吧,google了一个安装包下载,解压到apache htdocs目录,运行,提示没有安装MySQL扩展,Easy,再度运行安装程序,修改安装选项,加上MySQL扩展,然后再度运行phpmyadmin,还是提示没有MySQL扩展。嗯,没有任何事情是简单的。
查看PHP文档,说最好的安装方式是手动安装,怀疑是安装包的问题,卸载,下载PHP手动安装包,解压,按照文档说明,在httpd.conf中加入
# 配置 php.ini 的路径
PHPIniDir "C:/php5/"
# 对 PHP 5 用这两行:
LoadModule php5_module "c:/php5/php5apache2_2.dll"
AddType application/x-httpd-php .php
,然后复制php.ini-dist为php.ini,去掉GD2,MySQL扩展前面的分号,启动apache,运行phpmyadmin,还是提示没有MySQL扩展。仔细检查安装过程,C:/PHP5加到了环境变量Path中,php.ini中extension_path也更改了,httpd.conf中也加入了PHPIniDir,C:/PHP5/中也确实存在libmysql.dll文件,完全符合文档的描述,也没有什么疏漏,就是找不到。崩溃ing
参绕了好几天,google无数次,也没有搞定,后来病急乱投医,将libmysql.dll拷贝到Windowssystem32下面,MySQL扩展安装成功。晕倒,文档中说不建议拷贝php5ts.dll 到系统目录,将PHP目录加到PATH 环境变量就可以找到DLL,看来只是能找到php5ts.dll,找不到扩展所需的DLL?
三、搭建开发环境
我的首选当然是Eclipse了,下载PDT,代码提示、自动完成没什么问题,试一试Debug能力吧,打开Eclipse的帮助,找到PDT Debug一节,按照帮助提示试了试调试功能,

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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

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 is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

The process of starting MySQL in Docker consists of the following steps: Pull the MySQL image to create and start the container, set the root user password, and map the port verification connection Create the database and the user grants all permissions to the database

The main role of MySQL in web applications is to store and manage data. 1.MySQL efficiently processes user information, product catalogs, transaction records and other data. 2. Through SQL query, developers can extract information from the database to generate dynamic content. 3.MySQL works based on the client-server model to ensure acceptable query speed.

The core benefits of PHP include ease of learning, strong web development support, rich libraries and frameworks, high performance and scalability, cross-platform compatibility, and cost-effectiveness. 1) Easy to learn and use, suitable for beginners; 2) Good integration with web servers and supports multiple databases; 3) Have powerful frameworks such as Laravel; 4) High performance can be achieved through optimization; 5) Support multiple operating systems; 6) Open source to reduce development costs.

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP is suitable for web development and content management systems, and Python is suitable for data science, machine learning and automation scripts. 1.PHP performs well in building fast and scalable websites and applications and is commonly used in CMS such as WordPress. 2. Python has performed outstandingly in the fields of data science and machine learning, with rich libraries such as NumPy and TensorFlow.

PHP is a server-side scripting language used for dynamic web development and server-side applications. 1.PHP is an interpreted language that does not require compilation and is suitable for rapid development. 2. PHP code is embedded in HTML, making it easy to develop web pages. 3. PHP processes server-side logic, generates HTML output, and supports user interaction and data processing. 4. PHP can interact with the database, process form submission, and execute server-side tasks.

PHP has shaped the network over the past few decades and will continue to play an important role in web development. 1) PHP originated in 1994 and has become the first choice for developers due to its ease of use and seamless integration with MySQL. 2) Its core functions include generating dynamic content and integrating with the database, allowing the website to be updated in real time and displayed in personalized manner. 3) The wide application and ecosystem of PHP have driven its long-term impact, but it also faces version updates and security challenges. 4) Performance improvements in recent years, such as the release of PHP7, enable it to compete with modern languages. 5) In the future, PHP needs to deal with new challenges such as containerization and microservices, but its flexibility and active community make it adaptable.
