Skip to content

Using DateTime as a one-liner in PHP

A short and simple question which I couldn’t really find an answer for. In procedural PHP I could echo a date In Object oriented PHP I have to use two lines Is it possible to do this in one line? Answer There are two options: Create a DateTime instance using parenthesis and format the result: You can us…

How to install ffmpeg for PHP

I’ve successfully installed ffmpeg using ssh, as root, on my dedicated server (CentOS 7). ffmpeg works fine – but now I need to use it without root access. When i try to use ffmpeg without root access, I get the following error : The final goal is to be able to use ffmpeg inside my PHP scripts whi…