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

  • Home
  • SEARCH
  • 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 4118126
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:55:13+00:00 2026-05-20T22:55:13+00:00

Is there a way to run the following script via PHP http://www.magentoadvisor.com/magento-backup/tutorial-magento-backup-scripts-part-2/ I have

  • 0

Is there a way to run the following script via PHP

http://www.magentoadvisor.com/magento-backup/tutorial-magento-backup-scripts-part-2/

I have tried to use exec, shell_exec, system but none of them are working. They do work when I try exec(‘whois domain.com’) though so it must be something I am doing wrong!!

If this is not possible does anyone know of a good way of backuping up Magento via PHP, unfortuantely I don’t have SSH access.

Thanks

UPDATE
This is the code I am trying to use

system('magento-backup-script.bin -date', $output); 
var_dump($output);

Output: int(127)

Php safe mode is off

UPDATE:

I managed to get i working by copy the script into the PHP file and use the tactics operator to run the command. Thanks for all your help everyone

  • 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-05-20T22:55:14+00:00Added an answer on May 20, 2026 at 10:55 pm

    you can use system to execute commands on the system, for example:

    If your string is called backup and is located in /home/rob/scripts/backup/megento you can issue the command like so:

    if(false === ($line = system("/home/rob/scripts/backup/megento/backup",$result)))
    {
        echo "Error " . (int)$result . ": Backup failed: (" .  $line . ")\n";
    }
    

    if your getting the result 127, this is known as an exit code, int 127 usually means that the bas script attempted to execute a command but the command was not found.

    looking at the bash script it uses the tar command to create the archive, have you made sure tar exists and is installed on the server.

    you may also want to pipe the output to an error log to see what’s happening:

    system("/home/rob/scripts/backup/megento/backup >> results.txt");
    echo file_get_contents("/home/rob/scripts/backup/megento/results.txt");
    

    or if that is leading to an empty file maybe its a perms problem, try the following:

    exec("/home/rob/scripts/backup/megento/backup",$full_result);
    var_dump($full_results);// Array I believe.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way I could optimize the following script to run faster? foreach
Is there any way to run ASDoc on your project via the Flex Builder
Is there a way to run a specific Ant task via the keyboard? I
Consider the following XSLT script: <?xml version=1.0 encoding=ISO-8859-1?> <xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform> <xsl:output method=text encoding=iso-8859-1/>
Is there a way run Emacs from a USB drive? I am a Windows
Is there a way to run a regexp-string replace on the current line in
Is there a way to run some custom Javascript whenever a client-side ASP.NET validator
Is there a way to run an Amazon EC2 AMI image in Windows? I'd
Is there a way to run a project inside a solution that has more
Is there a way to run plain c code on top of the JVM?

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.