您的位置:首页 > 编程语言 > PHP开发

利用建站快速软件包:XAMPP,构建基于winodws平台快速搭建PHP的数据库应用- kimai - 团队时间记录

2017-06-20 21:27 1046 查看

前言:

用php编写的web应用程序,需运行在php的web容器中,其中apache server是一个针对php web容器,它是apache下的开源项目。
通常要运行一个web程序,我们还需要安装数据库软件,为了省去各种安装麻烦,选择xampp一键安装是比较好的方式,

1 本地:

Localhost 代表的是本机的位置, 通常其对应的IP 是127.0.0.1,那么首先要找到: kimai 的安装地方
http://127.0.0.1/BBS/HSY/kimai/installer/index.php
或者用:

2 快速构建php的运行环境。

网上下了一个包:xampp-portable-win32-5.6.15-2-VC11-installer

安装很简单(略),接着启动 xampp的控制器,界面如下:

利用上述的软件包可以快速搭建php + Apache( php实际是可以看成是apache的插件)所以,PHP运行,需要安装apache。

XAMPP 

XAMPP(Apache+MySQL+PHP+PERL)是一个功能强大的建站集成软件包。这个软件包原来的名字是 LAMPP,但是为了避免误解,最新的几个版本就改名为 XAMPP 了。它可以在Windows、Linux、Solaris、Mac OS X 等多种操作系统下安装使用,支持多语言:英文、简体中文、繁体中文、韩文、俄文、日文等。[1] 

许多人通过他们自己的经验认识到安装 Apache 服务器是件不容易的事儿。如果您想添加 MySQL、PHP 和 Perl,那就更难了。XAMPP 是一个易于安装且包含 MySQL、PHP 和 Perl 的 Apache 发行版。XAMPP 的确非常容易安装和使用:只需下载,解压缩,启动即可。

3 遇到的问题

3.1 端口占用

网上下了一个包:xampp-portable-win32-5.6.15-2-VC11-installer

XAMPP 经常遇到的问题就是连接不上,其中最重要的原因是,端口被占用了。

10:37:01  [Apache] Error: Apache shutdown unexpectedly.

10:37:01  [Apache] This may be due to a blocked port, missing dependencies, 

10:37:01  [Apache] improper privileges, a crash, or a shutdown by another method.

10:37:01  [Apache] Press the Logs button to view error logs and check

10:37:01  [Apache] the Windows Event Viewer for more clues

10:37:01  [Apache] If you need more help, copy and post this

10:37:01  [Apache] entire log window on the forums

3.1.1 解决办法

出现Apache shutdown unexpectedly错误的原因一般正如提示所说:端口被占用,依赖项丢失,权限不足,崩溃,或者非法关闭XAMPP.


可以通过运行apache/bin/httpd.exe 打印错误log获得错误信息。

【笔者案】

本次异常的错误信息如下:



80端口被占用了。

80端口会被其他的应用占用了,可能的原因有:


1 VS (visual station)

VS 是会占用80端口

2 Ms SQL 

3 IIS 

4 Web 服务器

关闭80端口的应用,或者,改变XAMPP的端口设定。

解决
最直接的方法是关闭占用80端口的进程: (但是如果进程ID为系统进程,例如4,那么杀掉这个进程,很可能会造成当机)

1. netstat -ano 看看 80端口被占用没 --这里 原来被虚拟机占用了 

2.通过cmd中打印tasklist,查找占用80端口的进程。 

3.taskkill /pid 端口号 杀掉此进程,XAMPP重启apache即可

3.2 Mysql 连接不上

14:04:57 [mysql] Problem detected!
14:04:57 [mysql] Port 3306 in use by ""C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" MySQL57"!
14:04:57 [mysql] MySQL WILL NOT start without the configured ports free!
14:04:57 [mysql] You need to uninstall/disable/reconfigure the blocking application
14:04:57 [mysql] or reconfigure MySQL and the Control Panel to listen on a different port
14:04:57 [mysql] Attempting to start MySQL app...
14:04:57 [mysql] Status change detected: running
14:05:00 [mysql] Status change detected: stopped
14:05:00 [mysql] Error: MySQL shutdown unexpectedly.
14:05:00 [mysql] This may be due to a blocked port, missing dependencies,
14:05:00 [mysql] improper privileges, a crash, or a shutdown by another method.
14:05:00 [mysql] Press the Logs button to view error logs and check
14:05:00 [mysql] the Windows Event Viewer for more clues
14:05:00 [mysql] If you need more help, copy and post this
14:05:00 [mysql] entire log window on the forums


Ref:

1 安装Xampp-配置appche,mysql运行环境遇到的坑
http://www.cnblogs.com/windfighter/p/4065109.html
2 install kimai
https://lowendbox.com/blog/how-to-install-kimai-time-tracking-software-on-ubuntu-16-04/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐