Help with setting a local test server on my windows vista

  • chu-boi
  • Newbie
  • Newbie
  • User avatar
  • Posts: 6

Post 3+ Months Ago

Hi all,
i'm new to web developing, i just started learning PHP and mySQL but its taking me so long because i have to upload my scripts to an online server to veiw them. I have been trying to get a local server on my pc running windows vista, i read tutorials like the one at http://www.ricocheting.com/server/php.html, it helped me get Apache set up and running, but i still can't get it to run my PHP files. Everytime i open http://127.0.0.1 it displays "it working". This is the only file it runs. I think there is something wrong with my directories.

Any help will be appreciated
  • George L.
  • Bronze Member
  • Bronze Member
  • George L.
  • Posts: 2209
  • Loc: Malaysia

Post 3+ Months Ago

Did you try this step?:
Quote:
To test your PHP simply create a test.php file in your Apache "DocumentRoot" folder (E:\public_html\ in my case). In your test.php file, type these 3 lines and then load the file in your browser like http://localhost/test.php (you should get a whole long list of php variables, settings, etc):



Code: [ Select ]
<?php
phpinfo();
?>
  1. <?php
  2. phpinfo();
  3. ?>
  • chu-boi
  • Newbie
  • Newbie
  • User avatar
  • Posts: 6

Post 3+ Months Ago

George L. wrote:
Did you try this step?:
Quote:
To test your PHP simply create a test.php file in your Apache "DocumentRoot" folder (E:\public_html\ in my case). In your test.php file, type these 3 lines and then load the file in your browser like http://localhost/test.php (you should get a whole long list of php variables, settings, etc):



Code: [ Select ]
 
<?php
phpinfo();
?>
 
 
  1.  
  2. <?php
  3. phpinfo();
  4. ?>
  5.  
  6.  


Hi,
Yeah i tried opening up http://localhost and it redirects me to ask.com, not sure why, but i if try http://127.0.0.1 it shows "its working". This tells me that the Apache server is on and running, then when i try to test the PHP with http://127.0.0.1/test.php it tells me the file doesn't exist. I think something is wrong with my directories.
I downloaded Apache version apache_2.2.11-win32-x86-no_ssl (windows installer package) and set DocumentRoot and Directory to the same location. For the PHP i downloaded the version php-5.2.9-2-Win32 and unzipped it to "C:/php" as per the tutorial. I set the PHP extension directory, extension_dir= "C:\php\ext" like in the tutorial and the doc_root to a folder where i write all my PHP scripts. In part 5 of the tutorial, "Editing Apache Conf File", i was a bit confused when it said to change both parts of C:/php to the directory you installed PHP to. This is what i put at the top of the apache conf file


LoadModule php5_module "C:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"

this might be causing the problem
Thanks for all your help
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

With apache, you're going to be looking for an 'htdocs' directory. That's where you'd need to drop your test file.
  • chu-boi
  • Newbie
  • Newbie
  • User avatar
  • Posts: 6

Post 3+ Months Ago

UPSGuy wrote:
With apache, you're going to be looking for an 'htdocs' directory. That's where you'd need to drop your test file.


I found the htdocs directory and I can open my HTML files on http://127.0.0.1, but it still doesn't run the PHP scripts only the HTML. I think i didn't correctly configure Apache to run PHP... any suggestions?

Thanks
  • George L.
  • Bronze Member
  • Bronze Member
  • George L.
  • Posts: 2209
  • Loc: Malaysia

Post 3+ Months Ago

When you run PHP scripts, was there any error messages? or the PHP scripts just show up plainly in reading mode? What text editors are you using? If you use Notepad, you save it as .PHP with All files.
  • George L.
  • Bronze Member
  • Bronze Member
  • George L.
  • Posts: 2209
  • Loc: Malaysia

Post 3+ Months Ago

If you want something easy to set up and be able to test your PHP scripts, try XAMPP Lite. It will not mess up with your computer's files.
  • chu-boi
  • Newbie
  • Newbie
  • User avatar
  • Posts: 6

Post 3+ Months Ago

When i run the PHP scripts on local server http://127.0.0.1, nothing shows up
  • chu-boi
  • Newbie
  • Newbie
  • User avatar
  • Posts: 6

Post 3+ Months Ago

Hi all,
I'm currently designing the login page for my site, i'm working with PHP, i'm looking for a PHP script that can be used to validate the user's input by matching it to values already stored in my database. Also I needed to add a comparison, so if the values are found in the database, the user can be REDIRECTED to a welcome page, else if the value are not found, an error message should show up telling the user that the values were not found. These values are username and password. Does anyone have any idea what script i could use for this?
Thanks george for the xampp tip, it is helping out a lot
  • chu-boi
  • Newbie
  • Newbie
  • User avatar
  • Posts: 6

Post 3+ Months Ago

Does anybody know how to use code-igniter. in the config.php file, where it says $config['base-url']= "", what url is it refering to?
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

That's a fairly common line, and it's usually asking for your domain or your install directory. If you want to make your code transition smoothly between dev/test/production environments, then use something like this:

Code: [ Select ]
$config['base_url'] = "http://".$_SERVER['HTTP_HOST'];
$config['base_url'] .= preg_replace('@/+$@','',dirname($_SERVER['SCRIPT_NAME'])).'/';
  1. $config['base_url'] = "http://".$_SERVER['HTTP_HOST'];
  2. $config['base_url'] .= preg_replace('@/+$@','',dirname($_SERVER['SCRIPT_NAME'])).'/';

Post Information

  • Total Posts in this topic: 11 posts
  • Users browsing this forum: No registered users and 70 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.