I got a script.php file.... how do i compile and run this script....
I got a script.php file.... how do i compile and run this script....
only do this if it's your own script - if it's not, please consult someone to check it out before trying it!
open up gnome terminal and execute:
then use the "cd" command to head to your php5 script directory, and do:Code:sudo apt-get install php5-cli
Code:php your-file.php
Blog
Linux user number: 433157 - Member of Cypriot, Serbian, Greek LoCos
Brainstorm: Official end-of-life dates list, Kernel boot parameter to disable modules, End-of-Life? Update manager should show EoL status and provide more info
A php script is usually used to build websites and is interpreted by a web server. If you want to run a php script yourself you can install the php5-cli package. If you want to use this php script to test and build a website then you will want to install the apache2 web server and php.
Open a gnome-terminal and do something like this:
Also you should probably do a web server if you want to use PHP for the conventional use (designing websites and databases).Code:sudo apt-get install php5 cd mylocation php myfile.php
PHP's best used with Apache.Code:sudo apt-get install apache2 sudo apt-get install mysql-client mysql-server php5-mysql
http://www.apache.org/
My AJAX apps project: https://launchpad.net/gold-os/
My Personal Website: http://jhuni.freehostia.com
I have installed both - PHP and Apache.
Now I need to run file index.php so it looks like in my browser like I visit the site.
How should I do this?
TIA
Michael
Found how to do this here http://www.howtogeek.com/howto/ubunt...che-on-ubuntu/
But /var/www is located in root folder, how can I obtain same at my home directory?
i got nothing from the link you gave....can any one help me how to run my php file in firefox....i have php and apache installed...this is my first php script
This code in terminal will take the php file and process it into a proper file, then opens it in firefox.Code:php myfile.php > myfile.html && firefox myfile.html
This simulates what a web server would do with said php script.
Dependencies: php5-cli, php5
Since you're a beginner, I recommend that you install a simple server to run php files called XAMPP (actually it's much more than just that, but lets leave that behind). Tutorials can be found all over the internet![]()
Your left hand is touching your face.
Bookmarks