You Can Run PHP Scripts Like Regular Command Line Apps on Linux!

preview_player
Показать описание
Whether you want to interact with a database from the Linux terminal, or create a cronjob that automatically caches content to speed up your web site, it's exciting to realize that PHP scripts can be written and run within the Linux command line interface just like a bash script! All you need is the php metapackage (eg., apt install php) and adding a single line to your script header:

#!/usr/bin/env php
Рекомендации по теме
Комментарии
Автор

this is not what i was looking for but this seems nice

quitting_the_internet
Автор

This is cool. For a while since I'm a Windows user most of the time, I wrote some commands for Linux that I can call using the "DOS" commands and it works very similar to what happens in Windows CMD terminal. This could open up the landscape and make it so I can parse some of the info and display it so it looks a little more familiar to me. Thanks for sharing this.

oritrond
Автор

This is super cool. I will write a worker using this.

danielgitahi
Автор

This is awesome. I was looking for a multi-thread script application for building and feeding databases while my web environment is responsive to the client environment. I know spears will be thrown at me, but it this also functional in a dos/windows command prompt (XAMPP)?

DJ-pnte
Автор

I have code interviews that they want me to create a program 8 queen chess problem running in the terminal. So I search on the internet that it is possible PHP can be accessed with the CLI way? and then here we go I found you, sir!

RazerSCYNescafe
Автор

This is great but I get a PDO error when trying to connect to my sqlite database, I get no driver error. Is there something else I need to install other than "apt install php" to get the database working?

matthew
Автор

I was looking for a remplacement for shell scripts (weird and limited language). So I thought I can use python or ruby for shell scripting but never thought php can be used here. So my question, is it worth it to learn php for system administration ?? Thanks

soufianta
Автор

BTW, Don't know if you know or if its just me but on some of the video's that you share like this one the audio is out of sync with your mouth. It's not the first video I have seen like this. Don't know if anyone else has noticed it or not.

oritrond
join shbcf.ru