How do I get the local IP address of the server using PHP?

I am developing a PHP application that will be run only on the local network of a business. The application will be installed to the server using a custom installer like thing we made using Stunnix Advanced Webserver.

As part of making the application more user friendly I am planning to display the LOCAL IP of the server so that it is extremely easy for the other computers in the network to access the application by just typing this IP in their address bar.

The problem is I cannot get the LOCAL IP of the server.

I have tried

SERVER_NAME ( Displays just )

REMOTE_ADDR ( Displays client external IP )

SERVER_ADDR displays the correct IP but it does so only if I access it from a client using the IP which totally defeats its purpose.

I just want to display the LOCAL IP of the server upon access directly from the server through http://localhost itself.

I am somewhat sure that this isn't possible. But if it is, please help.


I am developing a cross platform PHP server application kind of thing. We bundle Apache,PHP installers and a SQlite database as a one click installer alongside our PHP application to make it as user friendly as possible. Anyone can deploy it on their computer running Windows,Mac or Linux. After installing when the user opens the application on the server he can see the ip address [local ip] and port which can be used to connect to this server. The application will be run only on the local network and not on the internet.

It should show the local IP just like the Android app called Air Droid does. Screenshot :

Apache 2.4.1 undefined reference to `SSLv2_client_method’

I was previously running apache 2.2.20 and openssl 1.0.0e. I installed openssl 1.0.1, then downloaded the tarball for apache 2.4.1 and installed apr 1.4.6 & apr-util 1.4.1 with --prefix=/usr/local. I configured apache2 with:

sudo ./configure --prefix=/usr/local/apache2 --enable-mods-shared=all
--enable-deflate --enable-proxy --enable-proxy-balancer --enable-proxy-http
--enable-rewrite --enable-cache --enable-mem-cache --enable-ssl --enable-headers
--with-mpm=worker --with-included-apr

But after running sudo make I get an error:

httpd-2.4.1/support/ab.c:2227: undefined reference to `SSLv2_client_method'

What is causing this error and how do I correct it?

Apache and Node.js on the Same Server

I want to use Node because it's swift, uses the same language I am using on the client side, and it's non-blocking by definition. But the guy who I hired to write the program for file handling (saving, editing, renaming, downloading, uploading files, etc.), he wants to use apache. So, I must:

  1. convince him to use Node (he's giving up little ground on that)

  2. figure out how to upload, download, rename, save, etc. files in node or

  3. I must install apache and node on the same server.

Which is the most favorable situation, and how do I implement that?

Thank you very much.

How to remove ‘Parent Directory’ link from root folder in Apache directory listing

How can I allow directory listing in Apache for a specific (root) folder and its subfolders, but without showing a link to parent of that root folder. When user is in a subfolder, the 'Parent Directory'link is displayed to navigate to its parent, but when user is at the root folder I need to remove/hide this 'Parent Directory' link so that user cannot move above that 'root' hierarchy.