XAMPP / Xdebug : Xdebug not showing in phpinfo()

Today in XAMPP I’m trying to enable xdebug for use with Netbeans 7 and found a tricky problem that xdebug won’t even show up when doing:

phpinfo();

Leads me to check for php.ini file to make sure that I’m using the right one.

php.ini

I’ve edited the file under apache\bin to look like the following:

zend_extension_ts = D:\xampplite\php\ext\php_xdebug.dll
; XAMPP and XAMPP Lite 1.7.0 and later come with a bundled xdebug at <XAMPP_HOME>/php/ext/php_xdebug.dll, without a version number.
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
; Port number must match debugger port number in NetBeans IDE Tools > Options > PHP
xdebug.remote_handler=dbgp
xdebug.profiler_enable=1
xdebug.profiler_output_dir=”D:\xampplite\tmp”

This is a php showing xdebug enabled:

xampp with xdebug enabled

how to enable innodb in xampp

Reference: The InnoDB Storage Engine

Find the file name my.cnf on xampp directory on C: drive. Uncomment the line that says:

#skip-innodb

and make sure that it will look like this:

skip-innodb

***
There are at least other setup option for innodb next to this line, just follow the helpful hints and you’re off. I can’t provide definite lines on this coz sadly my computer has broken down again? *Me thinks, am I worthy to be called a tech?* EVIL GRIN!

how to change phpmyadmin theme

I just don’t want the default theme that came in with PHPMyAdmin they are huge and my eyes hurt when I look at them. If you are like me that doesn’t want to take extra step to develop themes and just want to have it appear smaller then this procedure is for you.

Enjoy!

automatically start xampp on boot

(also applies to xampplite)

What could be the search engine terms for this?

  • start xampp automatically
  • xampp as a service
  • xampp in windows startup folder

Here we go with the story:

I always favored simplicity and ease of life that’s why I have many articles relating to productivity(has also remodeled the links on my blog to simplify things up). Then since I am always using xampp as a development environment. I want it started when I start my PC.

So how it is going to be?

  • as a service
  • as a startup program for windows(more clutter on your taskbar)
  • other things(don’t know/forgot)

As a service

You can set this one by:

  1. Going first to your installation directory(in my case it’s c:\xampplite). It could be somewhere else depending on your installation. Have also my full version in c:\x2\xampp
  2. Once your in the installation directory find xampp-control.exe and click/double-click to launch it.
  3. You should first stop all running instances of your apache2 and mysqld/mysql to do this.
  4. Click the checkmark next to Apache and Mysql with the header name Service.
  5. It will warn you that it’s installing as a service which of course is what we like it to do. Click Yes.
  6. Do step 5 also with Mysql. We’re almost done.
  7. Click Start » then Run
  8. Type services.msc(it can also be done in control panel under administrative tools which is a way lot of click than this one).
  9. Find apache2 and mysql services
  10. Double click each one and set the startup type to Automatic (You will be presented with 3 options: Automatic, Manual, Disabled)
    Automatic – will start it automatically at startup
    Manual – user’s will have to start it up manually i.e. by issuing command like net start apache2
    Disabled – will disable it.
    ****be warned though that any change in the services just like the registry can cause your system to stall***
  11. Click the start button to manually start it(just for the session though). The next restart it’ll be automated.
  12. Do the same with mysql.

As a startup program

  1. Find xampp_start.exe from your installation directory
  2. Press Ctrl+C to copy it or right-click the file and hit copy.
  3. Go to C:\Documents and Settings\Administrator\Start Menu\Programs\Startup and right click on it and hit Paste Shortcut
  4. When you restart it’ll be starting also and you’ll see something like this:

  5. You can stop it by issuing the xampp_stop.exe command in your installation directory.
    ***another worth mentioning is that if you right click again on the shortcut and hit properties, try to change the run option to minimized. This way the shortcut will be on your taskbar once started.

Enjoy.

installing pear packages on xampp

Once you’re on PHP development on windows you can’t escape xampp. Only if you toke the stressful path of installing the system one by one i.e. install apache, then php, then mysql, then perl.. then you have a good choice/stand that you know how to configure the system itself.

One thing about xampplite is that it doesn’t have pear installed.

For me? I toke the simple steps. I am lazy.. that’s what programmers are(not generally).

First, go to your xampp installation directory/folder and navigate to the php directory. For me it’s x:\xamplite\php

x:

cd \xampplite\php

pear install <package-name>

There you have it, that should do the job installing the package you want. You may have to list the package to know what pear packages are already installed

pear list

restrict access to phpMyAdmin by authentication

Wondering how authentication/log-in form will be implemented in xampp? This edit in config.inc.php will handle the job.

The path for the configuration script is <your-xampp-installation-path>\phpMyAdmin\config.inc.php.

This line configures the authentication used by phpMyAdmin in accessing it:

$cfg['Servers'][$i]['auth_type'] = 'authentication method here'; // Authentication method (config, http or cookie based)?

Note:

If you replace the use authentication method here with:

config
- it will use the password and username from the configuration file. Remember the last tutorial? (read it here)

http
- will use the http authentication of Apache(secure/recommended settings)

cookie
- will use the database for username in authentication and will require browsers to allow cookie. (secure/recommended setting)

enabling phpMyAdmin once you change root password or permission or privileges on mysql database

This applies to xampp-1.5.3a:
(don’t know about other versions since I only have this one. It works also for xampplite)

Yes, after a fresh install of a xampp program you are welcomed with a xampp pseudo website which is located in <path of xampp installation>/htdocs/xampp/. Clicking security you are given some important points to secure your website. That includes changing the root password. But alas, after changing it you’ll not be given a chance to use the ever-friendly phpMyAdmin.

Find <path of xampp installation>/htdocs/xampp/phpmyadmin/config.inc.php

$cfg['Servers'][$i]['password'] = ”; // MySQL password

Change this so that it’ll reflect your current mysql password.

$cfg['Servers'][$i]['password'] = ‘your_password_here‘; // MySQL password

Don’t forget to save it aight?!

And if you read furthermore you can see that you can also restrict/assign a mysql user with just enough privilege to access the database. :)

apache 2 virtual directory the xampp approach

This tutorial is based on a solution to a problem encountered.

Operating environment: Windows XP

I always want to place my project on a separate directory under my documents for easy access. When I think of a solution I have come to this approach

  • allow directory navigation since my sandbox(the folder/directory) I will use does not contain any php/html only folders
  • create another pseudo domain for the sandbox for easy access

First I need to think of a directory to place my files/folders/directories d:\sandbox\ will be ideal since my documents are all in that directory.

All of my projects are placed on their particular folder under sandbox. I need to edit the following files:

httpd.conf
I have just copied this part to allow directory navigation. You don’t want this enabled in your enterprise application though.

<Directory “C:/x2/xampp/htdocs”>
#
# Possible values for the Options directive are “None”, “All”,
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that “MultiViews” must be named *explicitly* — “Options All”
# doesn’t give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks Includes ExecCGI
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be “All”, “None”, or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all

</Directory>

Eliminated all of comments to simplify it and added the sandbox folder/directory. Note and a warning: also that use a forward slash rather than windows backslash to do this. Normal directory path in windows will be d:\sandbox.

<Directory “D:/sandbox”>

Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All

Order allow,deny
Allow from all

</Directory>

httpd-vhosts.conf
My http daemon or the apache program I’m using is listening on port 8080. Apache 2 has included this part in extras folder in the installation path. How to set up port in apache tutorial is in here.

<VirtualHost *:8080>
DocumentRoot D:/sandbox
ServerName sandbox
</VirtualHost>

hosts
The full path is C:\WINDOWS\system32\drivers\etc>hosts. You can see a tutorial on this one in here.

# have stripped off the comments

127.0.0.1 localhost
127.0.0.1 testground.com
127.0.0.1 sandbox.testground.com
127.0.0.1 sandbox

making your http daemon or apache listen on a particular port

In your Apache installation folder(it is called this way in windows. can’t do anything on it :D ), find the particular line. That is the default port http daemon is using.

When I have installed xampp 1.5.3a I have installed it in c:\x2\xampp directory. Apache configuration should be on <xampp install directory>\apache\conf in my case c:\x2\xampp\apache\conf

Listen 80

Just change the number 80 to whatever port you want.

# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
Listen 8080

Why would you want to do that.

  • First I am using skype which in default is using port 80 for the call feature that it have.
  • Second to get more acquainted with the Apache software ;D
  • Third some security. Remember that any process that you can do to further deter an attacker can be helpful. It is somewhat security through obscurity.
  • Etc.

enabling mod rewrite in xampp

I know this is pretty lame but being not lame is not beginner friendly. Being used to htaccess’ power to make my links more user friendly. I find the default installation of xampp a bit of lacking it. Thought it’s only because I do have with me the lite version of it (xampplite). But I have with me a full installed xampp better yet check it. Nothing.

So I did a little poking into configuration file of apache that came bundled with it. This is what I found out. By default mod_rewrite module is not enabled by default so I took the following steps.

To enable mod_rewrite in xampp first go to the directory of installation <xampp-directory>\apache\conf  and edit httpd.conf. Find the line which contains
#LoadModule rewrite_module modules/mod_rewrite.so
uncomment this(should be):

LoadModule rewrite_module modules/mod_rewrite.so

Also find AllowOverride None 

Should be:

AllowOverride All

I really think it appears 2 or 3 times on the configuration file.

Happy xampping!