ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi, I found a tutorial to learn php...all it's good.
I make the example from tutorial
with extension *.php
<html>
<body>
<?php
echo "Hello World";
?>
</body>
</html>
In my tutorial doesn't say how to run it.
I tried file://file.php in browser
but shows me:
echo "Hello World";
?>
What do I have to do??
thanks
If you want to get started quickly without learning how to set up a production web server such as apache or a production SQL server such as mysql, look at XAMPP. It gives you everything you need in one bundle to start writing PHP and perl applications.
Do you have PHP installed? Put the file in the directory where pages are served from for your the server (you'll probably want to check the httpd.conf file for this, it'll be something like /var/www though but I can't be certain).
Do you have PHP installed? Put the file in the directory where pages are served from for your the server (you'll probably want to check the httpd.conf file for this, it'll be something like /var/www though but I can't be certain).
put the file in your apache pages directory like /var/www or c:\Program Files\Apache\www and open in your web browser something like this, http://localhost/name.php, where name is the name of your file, and to know if apache (httpd) is running simply open http://localhost/, and finally, never use file:// to open a php script, that opens the php as a text file and dont execute it.
Hi again, I put my file 1.php in /var/www and tried http://localhost/1.php
and it said Not Found;(and the apache server in started)
And I have php installed.
if I type only http://localhost/
it says: It works!!
thx
Location: Newcastle, England, Uk, Europe, The World, The Solar System
Distribution: Ubuntu Gusty Gibbon 7.10
Posts: 3
Rep:
U need to host it somewere... just make an accound on a free host and host on there... so you can see if you code works its what i did when i started to learn php. or install apache, install php and fire up you own server
In your 'httpd.conf' file, make sure you have a line something like this:
Code:
AddType application/x-httpd-php .php .phtml .html
so that it knows to interpret files with those extension with the parser. Also make sure the file has the appropriate permissions, -rw-rw-r-- will prolly do...
Hi it's me again...
I put 1.php in /var/www, I add "AddType application/x-httpd-php .php .phtml .html .htm" to httpd.conf and I started apache(apachectl -k start) and when I type http://localhost
it give me to download a thing 'which is a: application/x-httpd-php from http://localhost'
I hope you have time and pacience with me.
thx
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.