Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8737781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:35:59+00:00 2026-06-13T10:35:59+00:00

I actually managed to make an installation zip for a plugin that I made

  • 0

I actually managed to make an installation zip for a plugin that I made and in the installation script file, I included this code in the install function in order to copy some file in a folder within joomla in another directory.

class plgVmCustomPayeddownloadsInstallerScript {

   function install($parent) {

        $src = "plugins/vmcustom/payeddownloads/payeddownloads.php";
        $destination = "components/com_virtuemart/controllers";     
        if(!JFile::move($src, $destination,JPATH_ROOT)){
            echo "tried to move from ".$src." to ".$destination;
            return false;
    }
}

After the installation I keep getting an error in joomla, “unable to rename the file” and the file that was supposed to be moved commanded by the install function did not, despite the fact that the files within the installation.xml did actually get coppied and installed correctly.

Also within the installation script In the install function I included some sql which is executed normally without any problems.

and I also tried in the postflight function with no success.
Also I do not get any specific erros from the php_error.log

I also tried to create this weird test, with the above tester.php file in my root application of my joomla installation.

<?php
/**
 * @package     Joomla.Site
 * @copyright   Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

// Set flag that this is a parent file.
define('_JEXEC', 1);
define('DS', DIRECTORY_SEPARATOR);

if (file_exists(dirname(__FILE__) . '/defines.php')) {
    include_once dirname(__FILE__) . '/defines.php';
}

if (!defined('_JDEFINES')) {
    define('JPATH_BASE', dirname(__FILE__));
    require_once JPATH_BASE.'/includes/defines.php';
}

require_once JPATH_BASE.'/includes/framework.php';

// Mark afterLoad in the profiler.
JDEBUG ? $_PROFILER->mark('afterLoad') : null;

// Instantiate the application.
$app = JFactory::getApplication('site');

// Initialise the application.
$app->initialise();

// Mark afterIntialise in the profiler.
JDEBUG ? $_PROFILER->mark('afterInitialise') : null;

// Route the application.
$app->route();

// Mark afterRoute in the profiler.
JDEBUG ? $_PROFILER->mark('afterRoute') : null;

// Dispatch the application.
$app->dispatch();

// Mark afterDispatch in the profiler.
JDEBUG ? $_PROFILER->mark('afterDispatch') : null;

// Render the application.
$app->render();

// Mark afterRender in the profiler.
JDEBUG ? $_PROFILER->mark('afterRender') : null;


    //plugins/vmcustom/payeddownloads/payeddownloads.php to 
    //components/com_virtuemart/controllers
    jimport('joomla.filesystem.file');
    $src = JPATH_ROOT."/plugins/vmcustom/payeddownloads/payeddownloads.php";
    $destination = JPATH_ROOT."/components/com_virtuemart/controllers/";        
    echo $src."<br>";
    echo $destination."<br>";
    JFile::move($src,$destination);

?>

The file does not get moved from payeddownloads to controllers folder and it is not causing any error.

Also I need to mention that php.ini has error_reporting = E_ALL and display_errors = On.
Also the php_error.log captures the errors. If I type for example echo “lala”oo it will log the error and it will show it.
So I suspect that JFile::move has a bug and its not throwing any errors even though the file is not copied. Any suggestions please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:36:00+00:00Added an answer on June 13, 2026 at 10:36 am

    Try using the following instead. Few tweaks make to your code:

    function install($parent) {
    
        $src = JPATH_SITE . "/plugins/vmcustom/payeddownloads/payeddownloads.php";
        $destination = JPATH_SITE . "/components/com_virtuemart/controllers";
    
        if(JFile::exists($src)){
           echo "File Exists!";
        }
        else{
           echo "File Doesn't Exist!";
        }
        if(JFolder::exists($destination)){
           echo "Destination Folder Exists!";
        }
        else{
           echo "Destination Folder Doesn't Exist!";
        }
    
        JFile::move($src, $destination); // Move file
    
        if(JFile::move($src, $destination)){
           echo "File Successfully Moved!";
        }
        else{
           echo "failed to move from ".$src." to ".$destination;
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The included C# unit test and C code file attempts to pass a managed
Actually I am developing one application in that when application run first time it
Actually I am working on this for the last 3 or 4 weeks but
Actually I am stuck in middle of some mysql code. Can anyone suggest a
Actually i want that, suppose i have a colorcode #FF3366. How can i examine
Actually ,i am working on a livechat application its works fine.This application is tabbed
Background So I am writing an emotify script for my tumblr, so that when
I have information stored in a database (actually a content repository but this shouldn't
I have a C DLL that returns a pointer to a PAnsiChar string managed
So I have a script that includes forms that are stored in files named

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.