搜索
首页后端开发PHP7本地Apache服务器如何添加php7模块

相信都会时常考虑这样一个问题,那就是在本地Apache服务器如何添加php7模块?今天小编就来介绍一下,有需要的可以参考参考。

本地Apache服务器如何添加php7模块

Apache的一些基础命令

Options:
  -D name            : define a name for use in <IfDefine name> directives
  -d directory       : specify an alternate initial ServerRoot
  -f file            : specify an alternate ServerConfigFile
  -C "directive"     : process directive before reading config files
  -c "directive"     : process directive after reading config files
  -n name            : set service name and use its ServerConfigFile and ServerRoot
  -k start           : tell Apache to start
  -k restart         : tell running Apache to do a graceful restart
  -k stop|shutdown   : tell running Apache to shutdown
  -k install         : install an Apache service
  -k config          : change startup Options of an Apache service
  -k uninstall       : uninstall an Apache service
  -w                 : hold open the console window on error
  -e level           : show startup errors of level (see LogLevel)
  -E file            : log startup errors to file
  -v                 : show version number
  -V                 : show compile settings
  -h                 : list available command line options (this page)
  -l                 : list compiled in modules
  -L                 : list available configuration directives
  -t -D DUMP_VHOSTS  : show parsed vhost settings
  -t -D DUMP_RUN_CFG : show parsed run settings
  -S                 : a synonym for -t -D DUMP_VHOSTS -D DUMP_RUN_CFG
  -t -D DUMP_MODULES : show all loaded modules
  -M                 : a synonym for -t -D DUMP_MODULES
  -t -D DUMP_INCLUDES: show all included configuration files
  -t                 : run syntax check for config files
  -T                 : start without DocumentRoot(s) check
  -X                 : debug mode (only one worker, do not detach)
  ```
  在php官网下载php文件包VC15 x64 Thread Safe (2018-Mar-01 06:45:07)一定要是带有thread的
  之后再Apache的httpd.conf中加入

LoadModule php7_module C:/Apache24/php-7.2.3-src/php7apache2_4.dll

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

PHPIniDir D:/Apache24/php-7.2.3-src

`

运行httpd -k start就可以启动服务器了,在Apache的htdoc目录下写个index.php文件

<?php
phpinfo();

在localhost下就能看到效果了

之后修改php.ini文件

extension_dir = "C:/Apache24/php-7.2.3-src/ext"

default_charset = "UTF-8"

extension = php_mysql.dll

修改完这3个搭建任务就完成了

推荐学习:php视频教程

以上是本地Apache服务器如何添加php7模块的详细内容。更多信息请关注PHP中文网其他相关文章!

声明
本文转载于:CSDN。如有侵权,请联系admin@php.cn删除
PHP7有哪些版本引入了新的操作符PHP7有哪些版本引入了新的操作符Mar 03, 2025 pm 04:37 PM

本文详细介绍了PHP 7的新运营商:无效的(??),太空飞船(&lt; =&gt;)和无效的合并分配(?? =)操作员。 这些通过简化零检查和比较来增强代码的可读性和性能

PHP7不同版本对内存消耗有什么影响PHP7不同版本对内存消耗有什么影响Mar 03, 2025 pm 04:35 PM

PHP 7的次要版本差异产生微妙的记忆消耗变化。 尽管较新的版本通常通过Zend Engine和垃圾收集优化提高了性能和存储效率,但影响依赖于应用程序。 象征

如何优化PHP7代码以提高性能如何优化PHP7代码以提高性能Mar 03, 2025 pm 04:28 PM

本文研究了优化性能的PHP7代码。 它解决了常见的瓶颈,例如效率低下的数据库查询,I/O操作和内存泄漏。 解决方案包括有效的编码实践,数据库和缓存策略,异步

如何在PHP 7中有效使用会议?如何在PHP 7中有效使用会议?Mar 10, 2025 pm 06:20 PM

本文详细介绍了有效的PHP 7会话管理,涵盖了session_start(),$ _Session,session_destroy()和安全cookie处理等核心功能。 它强调了安全性最佳实践,包括HTTP,会话ID再生,S

PHP7的版本更新主要修复了哪些bugPHP7的版本更新主要修复了哪些bugMar 03, 2025 pm 04:36 PM

PHP 7通过解决众多错误,提高性能和增强安全性,从而显着改善了以前的版本。 密钥改进包括重写的Zend Engine 3,优化的内存管理和精制错误处理。而基因

如何使用New Relic等工具监视PHP 7的性能?如何使用New Relic等工具监视PHP 7的性能?Mar 10, 2025 pm 06:28 PM

本文解释了如何使用新遗物监视PHP 7应用程序性能。 它详细详细介绍了新的Relic的设置,关键绩效指标(KPI),例如APDEX分数和响应时间,通过交易轨迹的瓶颈标识和错误轨迹

如何从PHP 5.6升级到PHP 7?如何从PHP 5.6升级到PHP 7?Mar 10, 2025 pm 06:29 PM

本文详细介绍了将PHP 5.6升级为PHP 7,强调了备份,检查服务器兼容性以及选择升级方法(软件包管理器,编译,控制面板或Web服务器配置)等关键步骤。 它解决了Potentia

PHP7版本更新对session处理有什么影响PHP7版本更新对session处理有什么影响Mar 03, 2025 pm 04:31 PM

本文研究了PHP7中的会话处理,强调了增强的Zend引擎的性能提高。 它讨论了潜在的兼容性问题,从升级和详细信息优化策略的安全性和可伸缩性。

See all articles

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
2 周前By尊渡假赌尊渡假赌尊渡假赌
仓库:如何复兴队友
4 周前By尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒险:如何获得巨型种子
4 周前By尊渡假赌尊渡假赌尊渡假赌

热工具

安全考试浏览器

安全考试浏览器

Safe Exam Browser是一个安全的浏览器环境,用于安全地进行在线考试。该软件将任何计算机变成一个安全的工作站。它控制对任何实用工具的访问,并防止学生使用未经授权的资源。

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

功能强大的PHP集成开发环境

SublimeText3 英文版

SublimeText3 英文版

推荐:为Win版本,支持代码提示!

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具