Sunday, January 13th, 2008

Execute Linux commands in PHP by using backticks

You can execute linux commands within a php script - all you have to do is put the command line in backticks (`).

Recently, I had to upload an archive to a server which did not allow ssh. For files that I need to transfer, I just package them up in a neat archive and transfer the archive file via scp. Not having ssh access however, I uploaded the archive file via ftp and created a script which extracts the file the file looks like the following:
More…

3 comments » Filed under General Notes by rvdavid at 1:29.

back to top

Credits:

© rvdavid blogs: Web Development | Powered by WP 2.3.1

Tree theme modified based on headsetoptions