Solution : httpd: apr_sockaddr_info_get() failed for ip-xxx-xx-x-xxx

After a fresh install of Apache on a Centos machine I was getting this error.

Starting httpd: httpd: apr_sockaddr_info_get() failed for ip-xxx-xx-x-xxx
httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName

Nothing critical, the IP was still accesing the PHP pages. But we can remove the above warning messages by:

  1. Open the httpd.conf file
sudo nano /etc/httpd/conf/httpd.conf

2. Search the string : ServerName ( Ctrl + W)

3. Add/update the ServerName to

ServerName 127.0.0.1:80

4. Restart apache.

sudo service httpd restart

And it shows ,

Stopping httpd: [ OK ]
Starting httpd: [ OK ]

Yeah, learnt something new 🙂

How to enable Oracle Connection to PHP on XAMPP (on Windows)

1. Install XAMPP on your Windows machine. We were using the latest one v5.6.14 (you can download the same from here) on Windows XP.

2. Extract InstantClient to C:\instantclient_<version_no> folder (You can download the same from here)

3. Open system setting at Start Menu > My Computer (right click on the icon) > Select Properties > Advanced Tabs > Environment Variables.

4. Add to ‘System Variables’ by clicking ‘New’ button and insert the following values:

a. Variable Name : PATH

b. Variable Value : C:\instantclient_<version_no>

5. Click OK to accept new modification.

6. Open C:\xampp\php\php.ini by using notepad/any other text editor.

7. Find string oci8 and remove the ; symbol at the beginning of the string line.

8. Save and Exit.

9. Restart Apache server to accept new modification on xampp.

 

To Check if Oracle connection support is loaded or not-

1. Open web browser.

2. In the address section type http://localhost/xampp

3. Once page load, select phpinfo() menu from the link on the left section of the page.

4. Try to find string OCI8 by using the search function of your browser(or by using CTRL+F).

5. If there is string found on OCI in your phpinfo() page. Then you can start connection to your oracle database.

 

PHP code to connect to Oracle

1. Open notepad/your text editor

2. Type following code:

<?php

$conn=oci_connect(“username”,”password”,”db_hostname”);

If (!conn)

  echo “Failed to connect to Oracle”;

else

  echo “Succesfully connected with Oracle DB”;

?>

3. Save and exit the text files as : connection.php(All Files Category) at C:\xampp\htdocs\

4. Once saved, please open browser and enter URL http://localhost/connection.php

5. If you see Text stating “Successfully connected with Oracle DB“ , then you are good to go.

 

Ref: stackoverflow

Removing apache2 from ubuntu

Follow these steps to remove the apache2 service using Terminal (we were successfully able to uninstall Apache2 from Ubuntu 12.0.4 LTS):

  1. First stop the apache2 service if it is running with: sudo service apache2 stop
  2. Now remove and cleanup all the apache2 packages with:
    sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
    
  3. Finally, run sudo apt-get autoremove just in case any other cleanup in needed

You can do the following two tests to confirm apache has been removed:

  1. which apache2 – should return a blank line
  2. sudo service apache2 start – should return apache2: unrecognized service

Have a great day!

Source : AskUbuntu