views:

37

answers:

4

Do I need a special library to run PHP on Windows environment Vista?

I can write simple message like echo "hello" but whenever I try to run any these scripts no error nothing display on the page http://php.net/manual/en/function.crypt.php.

I'm new to PHP please help

+2  A: 

When in doubt...

<?php echo phpinfo(); ?>

If that code outputs information regarding your PHP version and settings, PHP is installed correctly.

There would be errors in your code if nothing is displaying. Post the code you are having trouble with and we can help you out.

Anthony Forloney
The samples codes are here
james
<?php echo phpinfo(); ?> works fine
james
sample codes are here http://php.net/manual/en/function.crypt.php.
james
What code snippet samples are you referring to? Edit the question above with the *actual* code you are using, this way we can try to reproduce what errors you may be experiencing.
Anthony Forloney
+1  A: 

Have you actually set up a local server? You'll need this to run PHP scripts. For a newbie I'd recommend WampServer since it's really easy and handles all the complexity of installing a server. Once installed and running, try http://localhost/ in your web browser.

Based on your comment though, I think the problem is that the sample code on the page you posted won't work on their own, you'd need to combine them with other things. For example the first one references a variable $user_input which you'd replace with a variable taken from user input (eg a form) on your site.

I suggest finding some tutorials online (or buy a book) and walk through various proper examples to familiarise yourself with PHP.

DisgruntledGoat
A: 

Do you have PHP / Apache installed at the moment? If you don't, try XAMPP. It comes with an easy and convenient installer.

Pekka
A: 

Like most languages your computer must have the language/compiler installed in order develop and run scripts/applications. PHP was originally designed for web development so you won't usually find it installed on PCs by default.

The easiest way to develop PHP is to upload the scripts to a web server that has PHP installed and then test in your browser in the same fashion that you'd test an HTML page.

Otherwise to do it locally on your computer you can install a web development environment which acts like a web server. Essentially eliminating the upload step.

I believe the most popular for Windows is Wamp Server

KThompson