Saturday, September 04, 2010

To see all open (listening) ports in Linux

Run
netstat -ntulp
or
lsof -i -n -P
for some more info

Wednesday, September 01, 2010

Apache/ PHP (XAMPP) does not recognize

Well, when I knew how to write the title of the post I already solved the problem.

After the new XAMPP install with PHP 5.3.4 my PHP code stopped to work, interpreting here and there like plain text. I was not sure what is going on: is that Savant who can not work with PHP 5.3.4 or anything else.

The problem was that this XAMPP install switches off 'short_open_tag' parameter in php.ini. Once I fixed it and restarted Apache everything worked just fine.

Apache (XAMPP) does not start: Virtual Hosts: "Directory path is invalid" - Windows 7

When installing and configuring XAMPP on Windows 7 64-bit I found a few issues.

One well known thing is that Apache fights with Skype for ports 80 and 443, who gets them first.

The solution is simple: just tell Skype not to use ports 80 and 443 - uncheck the box.



Another, a more complicated issue came the next. Once I get Apache running and successfully showing me the XAMPP welcome page, I found that Apache does not run with my virtual hosts file.

On Windows 7 Apache fails with 'path is invalid' message in 'error.log' if some directories are defined as 'Shared' in Windows Explorer. The strange thing that they also could be 'nearby' folders to the path, defined as a virtual host root.

For instance, if I have C:/Development/Project_1 and C:/Development/Project_2, Apache will fail to start with Virtual Host defined in C:/Development/Project_1 if C:/Development/Project_2 is shared.
Weird, but verified - it works this way.
A possible explanation can be that I also have 'Development' shared, so having 'Project_2' shared is like a 'nested-sharing', which obviosly is a nonsense practically speaking, but probably can confuse the OS / Apache. Just a thought.

Now, if you have a fairly complicated folders tree and some folders are defined as shared it's very difficult to find what is going on and what folders disturb you.

The solution:
I just recreated the whole 'Development' tree in a separate folder 'Dev'. Being moved, the folders get a OS warning that sharing will be disabled. The new 'Dev' tree with no folders sharing solves the problem with Apache, and after removing all the old folders I renamed 'Dev' back to 'Development', restoring my previous environment.