The Joomla! Extensions Directory ™

DirectPHP Plugin

DirectPHP - a plugin that allows direct embedding of PHP commands right inside Joomla content page!

Available for all Joomla versions: Joomla 1.0.x, native 1.5.x, 1.6.x, 1.7.x, 2.5.x and 3.0.x!

VIP: Don't forget to set the Filter Type to "No Filtering" so that you can enter PHP codes in a Joomla 1.6/1.7/2.5/3.0 articles.

Latest Update
v3.0 (for Joomla 3.0)
Released March 21, 2013

v2.5 (for Joomla 2.5)
Released January 25, 2012

v1.7 (for Joomla 1.7)
Released October 10, 2011

Native version of DirectPHP for Joomla 1.7!

Latest version: 1.6 (for Joomla 1.6)
Released Feb 21, 2011
Native version of DirectPHP for Joomla 1.6!

Latest version: 1.06 (for Joomla 1.0) and 1.56 (for Joomla 1.5).
Added one more parameter "Using No Editor". If you're not using any editor when editing content articles, select 'yes' for this parameter. This will allow you to freely use any HTML tags (such as or ).

Latest version: 1.05 (for Joomla 1.0) and 1.55 (for Joomla 1.5).
Main update: Thanks to Salvatore who informed me about some "mysterious" double-byte characters that get inserted into the DirectPHP code by the content editor of some of the non-English Joomla. These double-byte characters will cause error when processing the PHP commands with eval. Have fixed this in this version.

Latest version: 1.04 (for Joomla 1.0) and 1.54 (for Joomla 1.5).
Main update: now works with PHP4!


Like many other PHP programmers who use Joomla, all I wanted is a simple wish: the ability to include PHP in Joomla content page.

I did some research. Looks like currently the best plugin out there with good user feedback is Jumi. I tried. It works. But something is still missing. The problem I have with Jumi is that it only allows you to call or include another .php file. It doesn't allow you to include PHP commands right inside the content page.

What this means is that to run some PHP commands, you have to put them in an intermediate PHP file. You have to have this intermediate file even if all you want is to display the current date and time with "echo date('Y-m-d H:i:s')"! Imagine having hundreds of dynamic content pages. The intermediate files accumulate more and more and become difficult to maintain.

This is the reason I developed DirectPHP - a plugin that allows direct embedding of PHP commands right inside Joomla content page!

Key Features

* You can write direct PHP statements right inside the content page using the standard the standard php construct.

* You can freely intermix static contents with php commands.

* You can edit the php code right inside the default TinyMCE WYSIWYG Editor!

* You can easily serve different contents for registered and non-registered members.

* You can use 'include' or 'require' to load in your favorite PHP library and call any of the functions inside the library.

* Ability to bloc

Report Extension



Reviews: 6
Been using DirectPHP for so long, I can't remember why I haven't reviewed it till now. It has always worked excellently for my custom code needs. Used to use Jumi, but DirectPHP beats that hands down since you can type your PHP code into Joomla! articles directly. Difficulty level is minimal, instructions are clear and concise, and the steps do not take up to 5 minutes to get you started. I recommend!
Reviews: 1
Great product. I use Joomla in a unique way and without being able to put PHP direct into the article I could not use Joomla. Thanks
Reviews: 2
I've used other php plugins such as Juni. They work but I always thought it would be nice just to type the php code into Joomla.

I needed to add some php code today and decided to do a quick search and came across this plugin. I was looking for the crazy brackets or special hash tags that it took to make it work and to my surprise there were none. Simply type the php code into you content, WITH YOUR FAVORITE EDITOR TURNED ON!
Reviews: 7
DirectPHP is turning into one of my most used plugins. This functionality should be part of core Joomla. Excellent.
Reviews: 10
Is a good extension but I tried to connect to a remote database using php and it doesn't work (I tested the code outside joomla and it works), so I guess is not suitable for "more complicated" php. For some basic one it worked perfectly. Thanks!
Reviews: 1
This plugin was exactly what I was looking for!

Thank you!!
Reviews: 6
I was looking for a replacement for Sourcerer as the plugin kept showing up in Joomla's error log and it was quite expensive for the Pro version. After downloading this, enabling the plugin, I was able to add the PHP date field to Footer (as in Copyright 2013). It also lets you encode forms so you can have a newsletter signup form for say constant contact. Haven't tested it on JS (for google adsense) but I don't think it will be an issue.

Just be sure to insert your code by clicking the HTML editor button (in TinyMCE and JCE) and placing it there. Click save and Voila! Great plugin, great support, and it's free!
Reviews: 2
Fantastic! I had embedded PHP working in seconds without any need for configuration. Just remember to enable the plugin after upload / install.
Reviews: 3
Worked perfectly for my needs (using php date code inside a module). Plugin installed with no fuss. I enabled it and my php code worked instantly.
Reviews: 24
Just bought you a beer, mate! Really happy to have this valuable extension for free.

For anybody looking for a quick, easy and working solution to code php etc. directly into modules, content or anywhere else... you found it!

No fuss, no guessing, just plain working.
Reviews: 5
Had to add some code to the header of a single page for a google experiment and this nifty plugin did the trick! had always used Jumi in the past but was having trouble getting it to parse under 2.5.6 - DirectPHP worked outta the box!
Reviews: 1
This was a life saver!!!! So awesome, Thank you!! :0)
Reviews: 11
Works very easy. Like!
Reviews: 2
Very nice little plugin. Install, activate, write code... voilà

just great
Reviews: 1
I love configuration. I love opening a huge extension and having all sorts of problems getting it to work. This extension is nothing like that. I installed it. Didn't get any errors. Enabled the plugin. And here is the false advertising part. It says "content"... CONTENT! It doesn't say you can use it in content articles AND modules, but it works even in Yoo Zoo. No hassle, no configuration. Ridiculous. Takes all the fun out of using 3rd party extensions.
Reviews: 4
working very nice for me. thanks a lot.
Reviews: 4
I use this on an Intranet site to pull reports from MSSQL. It works perfectly!

Now, when will it work in 1.7? I successfully installed the 1.6 version, but TinyMCE just kept commenting out the code. Maybe I just didn't find the setting to not check code for TinyMCE?

Regardless, excellent plugin, thank you!
Reviews: 1
Plugin works exactly as its supposed to. easy to setup & use. Adds a whole new level of functionality to a joomla installation. A must have if you desire to use your own php code without using an iframe wrapper.

thx for this great free extension
Reviews: 5
Lovely, being able to add php code to a module....
Reviews: 2
It could be a good Extension, BUT whenever you try to download it you'll be redirected to a file called packupdate_build107_2060.exe. And this file is a Trojan virus called FakeVimes!

So please correct your homepage and kkep an eve of your page (if it has been hijacked) or delete it (if you placed it there)!
Page 1 of 2