【问题标题】:$ is not defined during a Magento installation through cPanel在通过 cPanel 安装 Magento 期间未定义 $
【发布时间】:2015-08-06 02:06:11
【问题描述】:

我正在尝试通过 Godaddy 将 Magento 社区版 1.9.2.1 安装到 cPanel 中。到目前为止,我已经将 tar 文件提取到文件管理器中,将 Magento 文件夹中的所有项目移动到根目录,并赋予文件夹适当的运行权限。

当我进入我的网站打开安装向导时,我看到了这个

我无法单击它不起作用的继续按钮。当我检查页面时,我得到了这些错误。

我认为这是一个 jQuery 问题。看起来该网站没有加载任何 JavaScript。我尝试在头部添加一个 jQuery CDN 链接,但无济于事。我已经将一个 jQuery CDN 保存到我的文件系统中并通过 head 调用它仍然没有。

我不知道是什么问题。我的浏览器中启用了 JavaScript,所以它应该可以工作。

【问题讨论】:

    标签: javascript jquery magento installation cpanel


    【解决方案1】:

    我认为这应该是权限问题。我附加了一个代码,将其复制到一个新文件中(例如 magento-cleanup.php )并上传到您的 magento 根目录并使用 url(http://youdomain/magento-cleanup.php)运行它。它可以帮助您解决权限问题。

    <?php
    
    ## Function to set file permissions to 0644 and folder permissions to 0755
    
    function AllDirChmod( $dir = "./", $dirModes = 0755, $fileModes = 0644 ){
       $d = new RecursiveDirectoryIterator( $dir );
       foreach( new RecursiveIteratorIterator( $d, 1 ) as $path ){
          if( $path->isDir() ) chmod( $path, $dirModes );
          else if( is_file( $path ) ) chmod( $path, $fileModes );
      }
    }
    
    ## Function to clean out the contents of specified directory
    
    function cleandir($dir) {
    
        if ($handle = opendir($dir)) {
            while (false !== ($file = readdir($handle))) {
                if ($file != '.' && $file != '..' && is_file($dir.'/'.$file)) {
                    if (unlink($dir.'/'.$file)) { }
                    else { echo $dir . '/' . $file . ' (file) NOT deleted!<br />'; }
                }
                else if ($file != '.' && $file != '..' && is_dir($dir.'/'.$file)) {
                    cleandir($dir.'/'.$file);
                    if (rmdir($dir.'/'.$file)) { }
                    else { echo $dir . '/' . $file . ' (directory) NOT deleted!<br />'; }
                }
            }
            closedir($handle);
        }
    
    }
    
    function isDirEmpty($dir){
         return (($files = @scandir($dir)) && count($files) <= 2);
    }
    
    echo "----------------------- CLEANUP START -------------------------<br/>";
    $start = (float) array_sum(explode(' ',microtime()));
    echo "<br/>*************** SETTING PERMISSIONS ***************<br/>";
    echo "Setting all folder permissions to 755<br/>";
    echo "Setting all file permissions to 644<br/>";
    AllDirChmod( "." );
    echo "Setting pear permissions to 550<br/>";
    chmod("pear", 550);
    
    echo "<br/>****************** CLEARING CACHE ******************<br/>";
    
    if (file_exists("var/cache")) {
        echo "Clearing var/cache<br/>";
        cleandir("var/cache");
    }
    
    if (file_exists("var/session")) {
        echo "Clearing var/session<br/>";
        cleandir("var/session");
    }
    
    if (file_exists("var/minifycache")) {
        echo "Clearing var/minifycache<br/>";
        cleandir("var/minifycache");
    }
    
    if (file_exists("downloader/pearlib/cache")) {
        echo "Clearing downloader/pearlib/cache<br/>";
        cleandir("downloader/pearlib/cache");
    }
    
    if (file_exists("downloader/pearlib/download")) {
        echo "Clearing downloader/pearlib/download<br/>";
        cleandir("downloader/pearlib/download");
    }
    
    if (file_exists("downloader/pearlib/pear.ini")) {
        echo "Removing downloader/pearlib/pear.ini<br/>";
        unlink ("downloader/pearlib/pear.ini");
    }
    
    echo "<br/>************** CHECKING FOR EXTENSIONS ***********<br/>";
    If (!isDirEmpty("app/code/local/")) { 
        echo "-= WARNING =- Overrides or extensions exist in the app/code/local folder<br/>";
    }
    If (!isDirEmpty("app/code/community/")) { 
        echo "-= WARNING =- Overrides or extensions exist in the app/code/community folder<br/>";
    }
    $end = (float) array_sum(explode(' ',microtime()));
    echo "<br/>------------------- CLEANUP COMPLETED in:". sprintf("%.4f", ($end-$start))." seconds ------------------<br/>";
    ?>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-21
      • 1970-01-01
      • 1970-01-01
      • 2019-09-17
      • 2018-03-12
      • 1970-01-01
      • 1970-01-01
      • 2016-01-19
      相关资源
      最近更新 更多