Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Independent PHP files in Joomla site

Options
  • 29-07-2010 11:46am
    #1
    Closed Accounts Posts: 18,163 ✭✭✭✭


    Hi folks

    A client has a Joomla site and I need to install a couple of independent PHP files and scripts.

    Unfortunately the Joomla site is the root of the site.

    Is there a predefined area within Joomla that's set up for this, or can I just put a file or folder alongside the main install ?

    And is there anything I need to watch out for in terms of htaccess, etc ?

    On my own test server putting up a file called test.php works, but I'm VERY wary of "experimenting" with a live site! :eek:

    TIA,
    Liam


Comments

  • Registered Users Posts: 29 Techbot


    Hi Liam,
    you have three options as far as I can tell (since I don't know what the scripts are)

    a) simply drop the files anywhere (in the root or whatever). This is fine as long as the scripts don't actually use any of the joomla database tables. It is up to you to ensure those scripts are secure if they use there own tables

    b) Install a joomla wrapper component like Jumli or sourcerer. Once installed you can place your scripts inside these wrappers using simple tags

    c) Code your scripts as actually components or modules. This is the most difficult option but it would allow you the most flexibility in the long run. Checkout the Pakt joomla books by LeBlanc for excellent tutorials on how to do this.

    Rob
    JoomlaIreland.org


  • Registered Users Posts: 6,509 ✭✭✭daymobrew


    Liam Byrne wrote: »
    On my own test server putting up a file called test.php works, but I'm VERY wary of "experimenting" with a live site! :eek:
    Be brave!
    When I do experiments on live sites I often upload the test file, see if it works, see if the site works and immediately delete the test file if I see problems. You could do it at a quiet time to minimise impact if there was a problem.


  • Closed Accounts Posts: 18,163 ✭✭✭✭Liam Byrne


    Techbot wrote: »
    Hi Liam,
    you have three options as far as I can tell (since I don't know what the scripts are)

    a) simply drop the files anywhere (in the root or whatever). This is fine as long as the scripts don't actually use any of the joomla database tables. It is up to you to ensure those scripts are secure if they use there own tables

    Rob
    JoomlaIreland.org

    Cheers Rob! If I can do that without impacting the Joomla operation then I'm sorted! :)

    I was basically wondering if the root was off-limits or if it had something like CakePHP's alternative "webroot" directly that's referenced if you just call what would otherwise seem to be a root folder file.

    If I can add a file and a folder in the actual root, and have them behave as normal, then that'll do me nicely!

    I know I was probably playing it over-cautious by not just trying it, but I don't like the thoughts of messing up a client's existing site while adding a new feature! :P

    Thanks again!
    L


  • Registered Users Posts: 14,003 ✭✭✭✭The Muppet


    Liam Byrne wrote: »
    Hi folks

    A client has a Joomla site and I need to install a couple of independent PHP files and scripts.

    Unfortunately the Joomla site is the root of the site.

    Is there a predefined area within Joomla that's set up for this, or can I just put a file or folder alongside the main install ?

    And is there anything I need to watch out for in terms of htaccess, etc ?

    On my own test server putting up a file called test.php works, but I'm VERY wary of "experimenting" with a live site! :eek:

    TIA,
    Liam

    With regards to working on a live joomla site I suggest you install akeeba backup and make a site bakup first , It's free and brilliant and you're only a few steps away fro a complete restore of your site if the inevitable happens.


  • Registered Users Posts: 1,213 ✭✭✭was.deevey


    +1 for akeeba, its the dogs nuts for a site backup..

    have a peek at direct PHP as well, basically you can embed the php code directly within an article/module.

    When working on a live site like that I generally create a new menu / article and link somewhere around the bottom of the page to test with, try embed in an article before testing in module position...least you wont knock your site off while you're playing.

    You might consider doing the Akeeba backup and do a restore to a new folder / database to test your scripts first rather than playing round on the live site if you are really unsure.


  • Advertisement
  • Closed Accounts Posts: 18,163 ✭✭✭✭Liam Byrne


    Cheers guys

    Will keep the akeeba tip in mind for any future projects, but didn't need it for this one; as I said, the functionality and files that I was adding are completely independent of Joomla - I'm not changing the existing setup at all - just didn't want to impact on it if Joomla didn't allow other files or folders in the root, or if the htaccess would prevent something else being accessible.


  • Registered Users Posts: 14,003 ✭✭✭✭The Muppet


    Joomsolo is also handy for tinkering around with. It's a stand alone joomal server which you can install on your own pc. I use it in conjunction with the afore mentioned akeeba backup and have a functional copy of my site on my pc to play with. Very handy.


    http://www.freedownloadscenter.com/Web_Authoring/Automated_Web_Publishing_Tools/JoomSolo_Joomla_Standalone_Server.html


Advertisement