Archive for March, 2009

Error installing apache,php on windows vista

Thursday, March 26th, 2009 by dreamluverz

I’ve done this before, I’ve installed it several times but how come this time it’s not working with the same settings that needed to be changed… a moment of confusion, annoyance and craziness flashed on my eyes. I’ve exerted every bit of energy left in my body, wasted every precious moment of my time, tried and checked every possible way to no luck at all!!!

What have I done wrong was all I can say. I can’t make Apache 2.2 and PHP 5.2 run on my notebook. A moment of silence…then I realized that whatever changes I’ve made on the php test file was not being reflected on the browser. I then again checked the path on the config files but everything was correct.

Btw, I was using php editor to modify the config files for I have read on some forums that you won’t be able to edit it with notepad in windows vista environment but you can with any php editors. Realizing that, I viewed the files using windows explorer if the changes I’ve made was reflected. Behold it’s not!!! Then I remembered another thing  mentioned on that thread that it’s because of the UAC (User Account Control) setting which you can find in Control Panel => User Accounts. Then right away I  turned it OFF, restarted the computer and re-opened the config files for apache(httpd.conf) and php(php.ini), applied the settings, saved it and problem solved!!! What a nightmare!!!

So first and foremost before installing apache or php always check your operating system if you’re running on windows vista environment which has some user settings that will make you CRAZY!!! :P

You can check the installation guide of apache 2.2, php 5.2 and mysql 5 for windows here. Goodluck! :P





apache error, operation has failed

Thursday, March 26th, 2009 by dreamluverz

Upon installing my apache on windows vista environment I encountered this error “…operation has failed.”. Make sure you have the correct path and dll file on you httpd.conf which is in my case located on this path C:\WEB

LoadModule php5_module “C:/WEB/PHP/php5apache2_2.dll”

and if still the problem persists open the apache monitor click on connect, type in or browse your computer name and restart apache.


You can also find here the quick guide on installing apache 2.2, php 5.2 and mysql 5.





Installing apache 2.2, php 5.2 and mysql 5 in windows vista

Thursday, March 26th, 2009 by dreamluverz

Here’s a quick guide for installing apache 2.2, php 5.2 and mysql 5 in windows vista.

Download needed files:
1. Apache – msi file
2. PHP – better choose the zip file than the msi installer
3. MYSQL – msi file
4. Create a folder on where you want your files to be placed. ie. C:\WEB

Before you proceed make you’re have turned off the UAC (User Account Control) setting  or else you’ll be on a big trouble.

A. Installing APACHE

Run the installer and just simply follow the instructions there and choose the option to run it as a service for your convenience. For the server name you can just put localhost. To make sure you’ve installed it properly open your browser and type http://localhost or http://your_computer_name and you will see a message saying IT WORKS!

B. Installing PHP

Unzip the files on the folder you’ve created on #4 which is C:\WEB. And that’s it.

C. Configuring APACHE and PHP settings

APACHE - Open httpd.conf on Apache Software Foundation/Apache2.2/conf/ and have the following settings below: TAKE NOTE OF THE FORWARD SLASH “/”.

1. Locate LoadModule and add these lines below:

  • LoadModule php5_module “C:/WEB/PHP/php5apache2_2.dll” - (Make sure you have the correct path and the name of the dll file or else you’ll encounter the error mentioned on the last part of this guide)
  • PHPIniDir “C:/WEB/PHP – (Location of your PHP mentioned on #4 )

2. Locate and uncomment the following:

  • ServerName localhost:80
  • LoadModule rewrite_module modules/mod_rewrite.so – optional, uncomment if you’ll be using mod_rewrite

3. Locate and change the path of the following lines to the folder you’ve created on #4.

  • DocumentRoot “C:/WEB”
  • <Directory “C:/WEB”>

4.  Locate and add the following

  • locate AddType and add  this line   AddType application/x-httpd-php .php
  • locate DirectoryIndex index.html  and index.php

5. Modify the following

  • Locate for <Directory “C:/WEB”> – the one you’ve just modified, the location of your files. Below it you will find Allowoverride None change it to Allowoverride All to be able to use htaccess file. - optional
  • Locate display_errors – Off  = You might want to turn this on, for debugging purposes. - optional

PHPOpen php.ini located in C:/WEB/PHP and have the following settings below: TAKE NOTE OF THE BACK SLASH “\”.

1. Locate and change the path to the folder you’ve created on #4.

  • doc_root = “C:\WEB”
  • extension_dir = “C:\WEB\PHP\ext”

2. Uncomment the following: Needed for mysql

  • extension=php_mysql.dll
  • extension=php_mysqli.dll

3. Optional. Locate and uncomment

  • short_open_tag = Off  – The default value is OFF change it to ON. You will need this if you use <? echo “hello”; ?> instead of <?php echo “hello”; ?>
  • E_ALL & ~E_NOTICE – Error reporting except for warnings and notices

D. Installing and configuring MYSQL

Just simply run the installer and follow the wizard configuration. Make sure apache is running.

Some errors you may encounter:

1. When starting the apache  you may encounter this error “...operation has failed “ – Just make sure you have the correct path for loadmodule mentioned on httpd.conf as well as other paths and if you still got the error open apache monitor click on connect and type your computer name and try starting apache again.

So that’s pretty much about it. Have fun!!!

Setting up SONY VAIO wireless connection

Monday, March 23rd, 2009 by dreamluverz

Here’s a good guide I found on Yahoo answers

Wireless does not mean Internet.

Wireless means you can connect to a wireless network. If the wireless network you connect to has Internet access, you’re set.

First question is:
Is your Dad’s Belkin router wireless? If not then, you’ll need a wireless router.

If you Dad’s Belkin router is wireless:
Log in to the router and check to see what the SSID is for the router. Also check to see if MAC filtering is enabled. Also check to see if WEP, WPA or WPA2 are enabled. You’ll need the password of the WEP, WPA, or WPA2 for entry into your system, so write it down. If MAC filtering is off on the wireless router:
1) Go to your laptop.
2) Run the search wireless network.
3) Pick the SSID of your Father’s Belkin router. Click on connect.
4) You will be prompted for a password.
5) Enter the password for the WEP, WPA, or WPA2.

You should get connected to the wireless router and should be able to access the Internet now.

If MAC filtering is enabled on the wireless router, you will need to find the MAC address for the laptop and then write it down. Then log back into the wireless router and add the MAC address of your laptop into the allow table on the router.

To find the MAC address on the laptop, open a command prompt and type in ipconfig /all <enter>
The physical address is the MAC address.

Javascript regexp usage

Tuesday, March 17th, 2009 by dreamluverz

I found this reference very helpful because I tend to forget the difference between match, test, search and so on.

Description Example
RegExp.exec(string)
Applies the RegExp to the given string, and returns the match information. var match = /s(amp)le/i.exec("Sample text")

match then contains ["Sample","amp"]

RegExp.test(string)
Tests if the given string matches the Regexp, and returns true if matching, false if not. var match = /sample/.test("Sample text")

match then contains false

String.match(pattern)
Matches given string with the RegExp. With g flag returns an array containing the matches, without g flag returns just the first match or if no match is found returns null. var str = "Watch out for the rock!".match(/r?or?/g)

str then contains ["o","or","ro"]

String.search(pattern)
Matches RegExp with string and returns the index of the beginning of the match if found, -1 if not. var ndx = "Watch out for the rock!".search(/for/)

ndx then contains 10

String.replace(pattern,string)
Replaces matches with the given string, and returns the edited string. var str = "Liorean said: My name is Liorean!".replace(/Liorean/g,'Big Fat Dork')

str then contains "Big Fat Dork said: My name is Big Fat Dork!"

String.split(pattern)
Cuts a string into an array, making cuts at matches. var str = "I am confused".split(/\s/g)

str then contains ["I","am","confused"]

source: http://www.javascriptkit.com/javatutors/redev3.shtml