首页 文章

在通过cPanel安装Magento期间未定义$

提问于
浏览
1

我试图通过Godaddy将Magento社区版1.9.2.1安装到cPanel中 . 到目前为止,我已将tar文件解压缩到文件管理器中,将Magento文件夹中的所有项目移动到root中,并给予文件夹适当的运行权限 .

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

My view going to my websites Url

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

The errors I get when I inspect element

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

我不知道是什么问题 . 我的浏览器启用了JavaScript,因此它应该可以运行 .

1 回答

  • 2

    我认为这应该是权限问题 . 我已经附加了一个代码,将其复制到一个新文件中(例如magento-cleanup.php)并上传到你的magento root并使用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!
    '; } } else if ($file != '.' && $file != '..' && is_dir($dir.'/'.$file)) { cleandir($dir.'/'.$file); if (rmdir($dir.'/'.$file)) { } else { echo $dir . '/' . $file . ' (directory) NOT deleted!
    '; } } } closedir($handle); } } function isDirEmpty($dir){ return (($files = @scandir($dir)) && count($files) <= 2); } echo "----------------------- CLEANUP START -------------------------
    "; $start = (float) array_sum(explode(' ',microtime())); echo "
    *************** SETTING PERMISSIONS ***************
    "; echo "Setting all folder permissions to 755
    "; echo "Setting all file permissions to 644
    "; AllDirChmod( "." ); echo "Setting pear permissions to 550
    "; chmod("pear", 550); echo "
    ****************** CLEARING CACHE ******************
    "; if (file_exists("var/cache")) { echo "Clearing var/cache
    "; cleandir("var/cache"); } if (file_exists("var/session")) { echo "Clearing var/session
    "; cleandir("var/session"); } if (file_exists("var/minifycache")) { echo "Clearing var/minifycache
    "; cleandir("var/minifycache"); } if (file_exists("downloader/pearlib/cache")) { echo "Clearing downloader/pearlib/cache
    "; cleandir("downloader/pearlib/cache"); } if (file_exists("downloader/pearlib/download")) { echo "Clearing downloader/pearlib/download
    "; cleandir("downloader/pearlib/download"); } if (file_exists("downloader/pearlib/pear.ini")) { echo "Removing downloader/pearlib/pear.ini
    "; unlink ("downloader/pearlib/pear.ini"); } echo "
    ************** CHECKING FOR EXTENSIONS ***********
    "; If (!isDirEmpty("app/code/local/")) { echo "-= WARNING =- Overrides or extensions exist in the app/code/local folder
    "; } If (!isDirEmpty("app/code/community/")) { echo "-= WARNING =- Overrides or extensions exist in the app/code/community folder
    "; } $end = (float) array_sum(explode(' ',microtime())); echo "
    ------------------- CLEANUP COMPLETED in:". sprintf("%.4f", ($end-$start))." seconds ------------------
    "; ?>

相关问题