phpeclipse+xampp开发环境上遇到的有关问题
phpeclipse+xampp开发环境下遇到的问题
最近在做一个PHP的web项目,开发环境是phpeclipse+xampp。
对于phpeclipse,下载phpeclipse插件后,直接将相应的features和plugins文件夹下的内容拷贝到eclipse目录下的features和plugins文件夹下,然后重启eclipse就可以了。
对于xampp,在网上下载相应的安装文件,直接安装就可以了,xampp是apache+mysql+php+perl,因此在安装完xampp后,你会发现在xampp安装目录下,有php文件夹,apache文件夹,mysql文件夹,perl文件夹等。即完成了apache,mysql,php,perl的安装。
安装完后,经常会遇到如下问题:
1.当开启xampp的时候,会报错。大致是:could not bind to 0.0.0.:80.原因一般是80端口被占用。
那么解决方法自然就有2种了,第一是把占用80端口的进程给kill掉,第二是将80端口换掉。
对于第一个方法,个人感觉不是很好,把进程杀掉后,随时都可能在你无意的操作中又出现,所以我是将80端口换掉,换成常用的8080端口。方法如下:
在xampp目录下,找到apache的配置文件,我的目录是C:\xampp\apache\conf\httpd.conf。大致在47行的样子,配置如下:
Listen 80
即默认监听80端口,那么只需要把80换成8080即可,修改如下:
Listen 8080
2.无法访问web页面。比如项目的网页是web/index.php时,当你访问http://localhost:8080/web/index.php时,会提示无法连接或者找不到页面的错误。原来是找不到要访问的页面。
我采用的解决方法是修改apache的配置文件。打开%XAMPP_HOME%\apache\conf\httpd.conf,我的目录是C:\xampp\apache\conf\httpd.conf。大约在184行,修改DocumentRoot的值为项目的路径,(我的项目路径为"E:\Workspaces\Eclipse”),所以如下:
DocumentRoot "E:\Workspaces\Eclipse"
同样,在大约211行的地方,修改Directory 的路径为之前设置的DocumentRoot路径,如下所示:
<Directory "E:\Workspaces\Eclipse">
修改完后,重启下apache就可以按类似于http://localhost:8080/web/index.php的URL进行访问了。

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

To set up a CGI directory in Apache, you need to perform the following steps: Create a CGI directory such as "cgi-bin", and grant Apache write permissions. Add the "ScriptAlias" directive block in the Apache configuration file to map the CGI directory to the "/cgi-bin" URL. Restart Apache.

When the Apache 80 port is occupied, the solution is as follows: find out the process that occupies the port and close it. Check the firewall settings to make sure Apache is not blocked. If the above method does not work, please reconfigure Apache to use a different port. Restart the Apache service.

Apache connects to a database requires the following steps: Install the database driver. Configure the web.xml file to create a connection pool. Create a JDBC data source and specify the connection settings. Use the JDBC API to access the database from Java code, including getting connections, creating statements, binding parameters, executing queries or updates, and processing results.

There are 3 ways to view the version on the Apache server: via the command line (apachectl -v or apache2ctl -v), check the server status page (http://<server IP or domain name>/server-status), or view the Apache configuration file (ServerVersion: Apache/<version number>).

The steps to start Apache are as follows: Install Apache (command: sudo apt-get install apache2 or download it from the official website) Start Apache (Linux: sudo systemctl start apache2; Windows: Right-click the "Apache2.4" service and select "Start") Check whether it has been started (Linux: sudo systemctl status apache2; Windows: Check the status of the "Apache2.4" service in the service manager) Enable boot automatically (optional, Linux: sudo systemctl

To delete an extra ServerName directive from Apache, you can take the following steps: Identify and delete the extra ServerName directive. Restart Apache to make the changes take effect. Check the configuration file to verify changes. Test the server to make sure the problem is resolved.

Apache cannot start because the following reasons may be: Configuration file syntax error. Conflict with other application ports. Permissions issue. Out of memory. Process deadlock. Daemon failure. SELinux permissions issues. Firewall problem. Software conflict.

How to view the Apache version? Start the Apache server: Use sudo service apache2 start to start the server. View version number: Use one of the following methods to view version: Command line: Run the apache2 -v command. Server Status Page: Access the default port of the Apache server (usually 80) in a web browser, and the version information is displayed at the bottom of the page.

DocumentRoot "D/我的文档/My Documents/Aptana Studio 3 Workspace"