Phpstorm Xampp



  1. Phpstorm Xampp Xdebug
  2. Phpstorm Xampp
  3. Phpstorm Xampp Mac
  4. Phpstorm Xampp Folder
  5. Phpstorm Xampp Debugging

In the local server configuration, you do your development, then copy the sources to the server.

A local server is a server that is running in a local or a mounted folder and whose document root is NOT the parent of the project root.

Phpstorm xampp setup

PhpStorm displays the version of the PHP engine detected in the specified folder and the debugger associated with this PHP engine in the php.ini file. In the Additional area of the CLI Interpreters dialog, you can optionally customize the configuration settings of the PHP installation. In the Debugger extension field, specify the path to Xdebug. First of all to create PHP projects you need to install and configure XAMPP with PhpStorm IDE. The very detailed JetBrains tutorial for this you can find here.For most people it is not convenient to keep all PHP projects in the default folder C: xampp htdocs.

To configure access to the server in this set-up, you need to specify the following:

  1. The server configuration root folder and the URL address to access it.

  2. Correspondence between the project root folder, the folder on the server to copy the data from the project root folder to, and the URL address to access the copied data on the server. This correspondence is called mapping.

Specify the name, type, and visibility of a server configuration

  1. Open the Deployment page by doing one of the following:

    • In the Settings/Preferences dialog Ctrl+Alt+S, go to Build, Execution, Deployment | Deployment.

    • From the main menu, select Tools | Deployment | Configuration.

  2. In the left-hand pane that lists all the existing server configurations, click Add and select Local or mounted folder in the popup menu.

  3. In the Create new server dialog that opens, type the name of the server to create and click OK. The Create new server dialog closes and you return to the Connection tab of the Deployment node.

  4. Click the Use as Default to have PhpStorm silently apply the current configuration in the following cases:

    • Automatic upload of changed files.

    • Manual upload and download of files without choosing the target host.

    • Comparing local files and folders with their remote versions.

    • Editing individual files on remote hosts.

  5. Use the Visible only for this project checkbox to configure the visibility of the server access configuration.

    • Select the checkbox to restrict the use of the configuration to the current project. Such configuration cannot be reused outside the current project. It does not appear in the list of available configurations in other projects.

      The server records are stored in the .idea directory together with the project, which allows sharing them between team members through a VCS.

      In the server access configurations list in the left-hand pane, the configurations visible only in the current project are marked with the icon.

    • When the checkbox is cleared, the configuration is visible in all PhpStorm projects. Its settings can be reused across several projects.

Specify the server configuration root and the URL address to access it

  1. Open the Deployment page by doing one of the following:

    • In the Settings/Preferences dialog Ctrl+Alt+S, go to Build, Execution, Deployment | Deployment.

    • From the main menu, select Tools | Deployment | Configuration.

  2. Click the Connection tab.

  3. In the Folder field, specify the server configuration root.

    The server configuration root is the highest folder in the file tree on the server that can be accessed through the server configuration. The easiest way is to use the document root of your Web server as defined in the Web server configuration file. However you can appoint any other existing folder under the document root.

  4. In the Web server URL field, specify the URL address of the server configuration root. This URL address will be the starting point for building the URL address of your application. Depending on your choice of the server configuration root, do one of the following:

    • Type the URL address associated with the document root of your Web server as defined in the Web server configuration file.

    • Type the URL address in the following format:

      <Server document root URL>/<path to the folder relative to the server document root>

    Both the HTTP and the HTTPS protocols are supported.

Map project folders to folders on the server and the URL addresses to access them

Configure mappings, that is, set correspondence between the project folders, the folders on the server to copy project files to, and the URL addresses to access the copied data on the server. The easiest way is to map the entire project root folder to a folder on the server. The project folder structure in this case will be repeated on the server, provided that you have selected the Create Empty directories checkbox in the Options dialog. For more details, see Configure synchronization with a Web server and Customize upload and download.

  1. Open the Deployment page by doing one of the following:

    • In the Settings/Preferences dialog Ctrl+Alt+S, go to Build, Execution, Deployment | Deployment.

    • From the main menu, select Tools | Deployment | Configuration.

  2. Click the Mappings tab.

  3. In the Local Path field, specify the full path to the desired local folder. In the simplest case it is the project root.

  4. In the Deployment Path field, specify the folder on the server where PhpStorm will upload the data from the folder specified in the Local Path field. Type the path to the folder relative to the server configuration root.

    If the folder with the specified name does not exist yet, PhpStorm will create it, provided that you have selected the Create Empty directories checkbox in the Options dialog. For more details, see Customize upload and download.

  5. In the Web Path field, type the path to the folder on the server relative to the server configuration root. Actually, type the relative path you typed in the Deployment Path field.

Example of specifying a server configuration root

For example, the server's default document root is the htdocs folder, and the default URL address to access the data is http://localhost. Let's suppose that you are using the XAMPP package and it is installed in the root of the C:/ drive.

If you decide to copy your project files directly under the server document root, your server configuration root will be C:xampphtdocs and its URL will be http://localhost:<port>.

You can establish a more complicated folder structure on the server, for example, to have MySite1 and MySite2 folders under the server document root. In this case the you will have to decide which of these folders you will use in the current configuration, let it be MySite2. Accordingly, the server configuration root will be C:xampphtdocsMySite2 and its URL address will be http://localhost:<port>MySite2.

Example of mapping project folders with folders on the server

For example, if your project is located under C:My_ProjectsMapping_project, the server document root is C:xampphtdocs, the server configuration root is C:xampphtdocsMySite2, and its URL address is http://localhost:<port>MySite2, fill in the fields as follows:

  1. In the Local Path field, type C:My_ProjectsMapping_project.

  2. In the Deployment Path field, type MySite2.

  3. In the Web Path field, type MySite2.

Skip to end of metadataGo to start of metadata

You are viewing an old version of this page. View the current version.

This tutorial will walk you through choosing and downloading the appropriate edition of XAMPP, downloading and installing the package, starting its components, and integrating them with the PhpStorm IDE.

XAMPP is a cross-platform package consisting of an Apache HTTP server, MySQL database, PHP interpreter, and Perl interpreter. The word 'XAMPP' is an acronym, where 'X' stands for 'cross', meaning 'cross-platform', and the other letters stand for the package components.

XAMPP is a reliable and fast way to set up environment for PHP programming. It provides all the components required for developing, running, debugging, and unit testing of PHP applications. XAMPP is a good alternative to installing and configuring a Web server, a PHP engine, a database server, and a debug engine separately. All you need to do to start developing is download XAMPP, run XAMPP installer.exe, and start the components using the XAMPP control panel.

  • XAMPP for Windows
  • XAMPP Control Panel
  • Integrating XAMPP with the IDE

Prerequisites

Before starting, the following tools should be available on your system:

  • Either PhpStorm or IntelliJ IDEA Ultimate Edition
  • When working with IntelliJ IDEA:
    • The Remote Hosts Access plugin should be enabled (installed and enabled by default with IntelliJ IDEA and PhpStorm)
    • The PHP plugin should be installed and enabled

Choosing the right XAMPP edition

From the Apache friends, we can download and install the XAMPP edition which matches our platform and operating system. The following versions are available:

  • The latest version compatible with Windows NT is XAMPP 1.7.2.
  • The earliest version compatible with Windows Vista is XAMPP 1.7.2.
  • Newer versions of Windows (Windows Server 2008 R2, Windows Server 2012, Windows 7 and Windows 8) can make use of XAMPP versions higher than XAMPP 1.7.4.
  1. XAMPP for Solaris works only on SPARC systems and does not run on x86 processors.

XAMPP for Windows

In this tutorial, we will use the latest XAMPP 1.8.2 version.

Downloading the XAMPP installer

From the XAMPP downloads page, we can find a list of components that are included in the package. In the Download section, click the XAMPP link to display a list of downloads available.

There are a number of download flavors available:

  • The installer, which sets up the XAMPP folder structure
  • The ZIP or 7zip files, which contain all required binaries and configuration but don't come with a wizard to get started

We will be using the installer for now. If you do want to make use of the ZIP or 7zip files, please run the setup_xampp.bat file once the archive is extracted.

Once the download of the installer is completed, we can run it.

Running the XAMPP installer

Once the XAMPP installer is asked, we may be prompted with the following notification:

This warning can be ignored in most situations, please check the http://bitnami.com/antivirus website for more information.

Depending on our operating system and settings, we may also see the following message:

If you have UAC enabled on your Windows Vista, Windows 7 or Windows 8 machine, it is recommended not to install XAMPP into the Program Files folder.

XAMPP installation wizard

The XAMPP installation wizard is pretty straightforward. Using the Next button, we can navigate through all steps in the installation.

One of the first steps where input is required is the Select Components step. In here, we have to specify which components we want to install with XAMPP:

Depending on our plans, we can add/remove certain components here. To work with PHP, we typically require Apache, MySQL (if we want to work with a database) and PHP. Other components are utilities which may come in handy, such as the Fake Sendmail which mimics a mail server that can be used during development.

Next, we have to specify the installation folder. We will be using the c:xampp folder.

After clicking the Next Emvscard ds multifunction devices driver download for windows 10. button again, all required components are extracted to the specified folder.

After extracting and installing all files, we can launch the XAMPP control panel. Let's keep the checkbox ticked and use the Finish button to complete installation.

XAMPP Control Panel

After installation, we can use the XAMPP Control Panel to perform several actions such as starting / stopping servers and changing configurations.

Starting and stopping servers

To start a specific server, click the Start button next to them. To stop a running server, we can use the Stop button. Let's start the Apache server by clicking the Start button.

Phpstorm Xampp

Depending on your system configuration, starting Apache may fail. If that is the case, verify that no other software is listening on TCP ports 80 and 443. Other web servers such as IIS may be using these ports, as well as Skype or other software. Close these other programs and try again, or modify the Apache configuration to listen on different TCP ports.

Starting a server as a Windows Service

By default, none of the servers such as Apache or MySQL are installed as Windows Service. This means that whenever we want to make use of these servers, we have to manually start them through the XAMPP Control Panel.

If we want to run specific servers as a Windows Service so they start whenever Windows is started, we can open the XAMPP Control Panel as an administrator. Next, stop the server using the Stop button.

Once stopped, we can click the X next to the server we want to install as a Windows Service. For example, we can install Apache as a Windows Service. After clicking the X, we have to confirm installation by clicking Yes.

Once the installation succeeds, the server will display a green checkmark, indicating the server is now running as a Windows Service.

Note that we can still start and stop our servers using the button in the XAMPP Control Panel.

Integrating XAMPP with the IDE

Now that we have installed XAMPP and launched its components, we need to tell our IDE where these components are stored and how they are configured.

Phpstorm Xampp

Integrating the PHP executable

Let's start by registering the PHP executable from XAMPP in PhpStorm. When in a PHP project, we can do this using the File | Settings menu (Ctrl+Shift+S or Cmd+Shift+S on Mac), navigating to the Project Settings | PHP.

With IntelliJ IDEA and PhpStorm, we can have several separate PHP interpreters registered in the IDE, depending on the PHP version and/or PHP configuration needed for the project. All currently registered installations of PHP interpreters are displayed in the Interpreter drop-down list:

We can add the one we've installed with XAMPP by clicking the Browse button (). This will bring up the Interpreters dialog box.

Phpstorm Xampp Xdebug

  1. In the left-hand pane, click the Add button on the toolbar.
  2. In the Name text box, type the name to identify the current installation, for example PHP from XAMPP.
  3. In the PHP Home text box, specify the folder where the PHP executable file php.exe is stored. Since we have installed XAMPP to c:xampp the PHP home directory will be C:xamppphp. We can enter this path manually or use the Browse button to find the path on our system.
  4. The IDE checks whether the specified folder contains a PHP executable file, detects the PHP version, and displays it in the PHP Info read-only field.

We can now save these settings and select the newly added PHP interpreter for our project:

Our IntelliJ IDEA or PhpStorm IDE will now make use of the PHP installation that was bundled with XAMPP.

Integrating the debugger

PhpStorm offers a powerful debugger in which breakpoints can be set and variables can be inspected at runtime. For more information on using PhpStorm's debugger, have a look at any of the following articles:

Integrating the Apache server

Phpstorm Xampp

Interaction between IntelliJ IDEA or PhpStorm with Web, FTP, and other servers is supported through the Remote Hosts Access plugin, which is enabled by default for IntelliJ IDEA and PhpStorm. The IDE accesses servers using connection settings specified in the registered server access configurations. These configurations are created and managed in the Project Settings |Deployment page of the Settings dialog box.

Choose File | Settings on the main menu again to open the Settings. Click Deployment under the Project Settings node to go to the Deployment page.

From the toolbar, click the Add button to add a new server. From the Add Server dialog, we can specify a name for our XAMPP server and select the deployment type. For XAMPP's Apache server, select the Local or mounted folder type.

Phpstorm Xampp

After clicking OK, we can specify the folder to Apache's web root (C:xampphtdocs) and the URL to the web server, http://localhost. Note that these settings may be different depending on how you have configured the XAMPP Apache server through the C:xamppapacheconfhttpd.conf configuration file.

Phpstorm

Using the Open button, we can verify settings are ok. Once done, we should be seeing the XAMPP homepage.

Integrating the MySQL server

IntelliJ IDEA and PhpStorm provide us the possibility to connect to the XAMPP MySQL database server using the Database plugin (installed and enabled by default). First of all, make sure the MySQL server is running from the XAMPP Control Panel.

Next, from the right-hand side of our IDE, we can open the database tool window.

Opening the database pane, we can create a new connection or Data Source by using the context menu. We'll have to specify the JDBC database driver to be used to connect to our database. For MySQL, we can use the MySQL Connector driver available in the list of drivers. PhpStorm doesn't ship these drivers but a simple click (on Click here) fetches the correct JDBC driver from the Internet.

Phpstorm Xampp Mac

Next, we'll have to enter our connection details. As the JDBC driver class, select the com.mysql.jdbc.Driver driver. The Database URL should be a connection string to our MySQL Database, for example jdbc:mysql://localhost:3306/ or jdbc:mysql://localhost:3306/foodb to connect to the foodb database. We can also specify the username and password for MySQL, root and a blank password for a standard XAMPP installation. Note it is recommended to change the default MySQL username and password after the XAMPP installation. This can be done through http://localhost/security/xamppsecurity.php.

Phpstorm Xampp Folder

Using the Test Connection button, we can verify the settings and make sure PhpStorm can connect to MySQL. Dual tv driver download.

Phpstorm Xampp Debugging

We can now create tables, run queries, update data and so on. See this blog post for more information.