I know this is probably a dumb question for most of you - but I just recently installed ubuntu, installed XAMPP, run it(apache + mysql working) - now I'd like to use shell to run some of the php files.
On Windows, I simply run the XAMPP Control Panel and I'm able to run the shell from it. In the Linux version of XAMPP, there's no such option - can please someone tell me how can I run the files on my local server?
When I simply run Terminal and type php -f xxx.php it tells me that program php is currently not installed - however based on the fact that I'm able to run the php files using web browser, I assume it's just trying to run the php file withou using the apache.
Thanks in advance for any advice
2 Answers
When I simply run Terminal and type php -f xxx.php it tells me that program php is currently not installed…
Which is correct. Please uninstall XAMPP and familiarize yourself with the LAMP stack that Ubuntu provides. This will automatically set up everything the way it was meant to be. The error message usually also tells you the package where you can find the program it it isn't currently installed, the PHP CLI program for example can be installed from the php5-cli package.
You can run the command as:
In linux terminal:
./Your_folder_where_lampp_is_stored/lampp/bin/mysqlYou can access same as xampp shell in windows.
If you get error, then use sudo to pretext the above script.
sudo ./Your_folder_where_lampp_is_stored/lampp/bin/mysql