Question:
Why wont my laptop run php?
White
2012-09-03 14:31:01 UTC
so I saved a file named test.PHP in NotePad++ I had it set for PHP and I wrote this $a = 5;
$b = 10;

function myTest()
{
global $a, + $b;
$b = $a + $b;
}

myTest();
echo $b;
?>
the out put should be 15 right? I ran it in Firefox internet explorer & chrome nothing showed up I saved it and ran it for it to run do I need a special program or sum thing? can some one give me some PHP script to test? if it works I'll update this part but please help me
Four answers:
anonymous
2012-09-03 20:43:49 UTC
PHP:



Run PHP on your own computer: The easiest way to do this is to install a complete package like XAMPP. This contains the Apache Web server, along with PHP and the MySQL database engine, in one easy-to-install package. XAMPP ( http://www.apachefriends.org/en/xampp-windows.html ) is available for Windows, Mac OS X, and Linux. (A popular alternative on Windows is WampServer [ http://www.wampserver.com/en/ ].)



Run your PHP scripts on your Web host: If you already have a Web hosting account that supports PHP then you can upload your PHP scripts via FTP and run them on the Web server. The advantage of this approach is that you don't have to install anything; the disadvantage is that it's slower to write and test your scripts.



Copy and paste the script code listed above into a new document in your text editor, then save the file as hello.php in the document root folder — that is, the top level of your website — on your hard drive. If you're not sure where your document root folder is then consult your Web server manual. Common locations include:

------------------------------------------------------------------------------

XAMPP on Windows: C:/xampp/htdocs/ (If you install it anywhere else, it WON'T WORK. Save your project in, say C:/xampp/htdocs/mycode/ , where you install "index.php"; Click on xampp-control icon, click "start apache", click "start mysql". Open browser and call php script: http://localhost/mycode/ in the address bar. "index.php" file will be parsed and shown in browser.)



XAMPP on Linux: /opt/lampp/htdocs/



If you want to run the script on your Web hosting account rather than your own computer then you'll need to upload the script using FTP instead.



Free online PHP tester: http://forumferney.free.fr/stester.html



PHP Tutorial - Databases in PHP, An Introduction: http://www.htmlgoodies.com/beyond/php/article.php/3511346

Tutorial: Installing Apache and PHP Under Win32: http://www.htmlgoodies.com/beyond/php/article.php/3473471



PHP Manual - http://www.php.net/manual/en/

A simple tutorial - http://us.php.net/tut.php

Test scripts: http://www.karakas-online.de/EN-Book/test-scripts.html

Simple Test for PHP: http://www.lastcraft.com/simple_test.php



More...
VBA
2012-09-03 15:00:17 UTC
To run a PHP script locally, you must have a webserver set up that will serve PHP pages. Try XAMPP:

http://www.apachefriends.org/en/xampp.html



Also, change global $a, + $b; to global $a, $b;
bourdeaux
2016-08-02 13:05:49 UTC
Laptops are mobile instruments, they do not handle the warmness very well, they usually do not like it. Is the gadget nonetheless getting sizzling? Perhaps re-set up drivers, probably approach fix, possibly hardware harm (vga/ram).
Till all are Genesic
2012-09-03 14:37:10 UTC
Try deleting and reinstalling system 32.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...