Home » Categories » PHP » Command Lines

How to execute PHP code from the command line?

echo '<?php echo xxx;' | php

echo '<?php echo file_get_contents("https://www.example.com/test.php");' | php

echo '<?php echo file_get_contents("https://www.example.com/?fc=module&module=pagecache&controller=clearcache&token=xxX43XX0X7XxXXxx");' | php


References:

https://www.w3schools.com/php/func_filesystem_file_get_contents.asp

https://stackoverflow.com/questions/9520090/how-to-execute-php-code-from-the-command-line

Article Rating (No Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
 
Attachments Attachments
There are no attachments for this article.
Comments Comments
There are no comments for this article. Be the first to post a comment.
Related Articles RSS Feed
There are no related articles for this article.