اذهب إلى المحتوى

Mounir Fasi

الأعضاء
  • المساهمات

    19
  • تاريخ الانضمام

  • تاريخ آخر زيارة

أجوبة بواسطة Mounir Fasi

  1. بتاريخ 9 ساعات قال Wael Aljamal:

    *** ربما تحتاج للخطوة التالية ****

    لديك مشكلة صلاحية في مجلد الجذر للمشروع، عليك تنفيذ الأوامر التالية إما من محرر أوامر الاستضافة إن وجد أو استعمل اتصال SSH سيمكنك من تنفيذ هذه الأوامر لتغيير الصلاحيات على المجلدات والملفات (ربما يمكنك عملها من لوحة التحكم ولكن لا أعلم إن كانت ممكنة)

    
    // استبدل المسار ل root المشروع
    
    sudo chown -R www-data:www-data /path/to/laravel  
    
    sudo find /path/to/laravel -type f -exec chmod 644 {} \;
    sudo find /path/to/laravel -type d -exec chmod 755 {} \;
    
    
    cd /path/to/laravel
    sudo chgrp -R www-data storage bootstrap/cache
    sudo chmod -R ug+rwx storage bootstrap/cache

     

    إتاحة جميع الصلاحيات بغرض التجربة:

    
    sudo chmod -R 777 /"your files location"
                         المسار للمجلد الجذر

    @Mounir Fasi

    أخي موجه الأوامر غير موجود في استضافة عندي.

    عندما اقوم برفع سكربت أصلي على استضافة وادخل الى رابط الموقع ادخل مباشرة الى مرحلة تنصيب سكربت بشكل عادي وعند الإنتهاء من تنصيب السكربت يعمل الموقع بشكل عادي لكن عندما ارفع النسخة التي كنت اعمل عليها بالـ localhost لا يعمل الموقع وعندما اقوم بتفحص جميع ملفات السكربت أصلي بدون تعديلات اجد نفس اعدادات والمسارات الموجوده بالملفات الاخرى بالنسخة التي كنت اشتغل عليها.

    هل يمكن ان يكون المشكل بملف server.php  ?

    <?php
    
    /**
     * Laravel - A PHP Framework For Web Artisans
     *
     * @package  Laravel
     * @author   Taylor Otwell <taylor@laravel.com>
     */
    
    $uri = urldecode(
        parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
    );
    
    // This file allows us to emulate Apache's "mod_rewrite" functionality from the
    // built-in PHP web server. This provides a convenient way to test a Laravel
    // application without having installed a "real" web server software here.
    if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
        return false;
    }
    
    require_once __DIR__.'/public/index.php';

     

  2. بتاريخ منذ ساعة مضت قال Wael Aljamal:

    هو غير موجود لأنه محذوف ربما.

    إعادة تسمية الملف config.php في المسار 

    
    laravelFolder/bootstrap/cache

    تعمل على حذف الذاكرة المؤقتة

    أخي ملف config.php غير موجود بداخل bootstrap/cache ايضا غير موجود على localhost لكن يعمل الموقع على localhost بشكل عادي

    cPanel-File-Manager-v5.thumb.png.bb87ebff23eb6196f64291142ed454d3.png

  3. بتاريخ منذ ساعة مضت قال Wael Aljamal:

    ربما هنالك مشكلة في الملفات المؤقتة، حيث يمكن تنفيذ التعليمة التالية في مجلد المشروع

    
    php artisan optimize:clear

    في مدير الأوامر cmd ثم حاول مجدداً رفع المشروع (اعمل نسخة عن الملفات التي عدلها مثل env.)

    وفك ضغط الملف المضغوط في publlic_html مباشرة

    قمت بتنفيذ الأمر لكن دون جدوى

    كيف يمكنني حدف الـ cache من cpanel

    او اين يوجد مسار ملف cache علما انه غير موجود بداخل ملف مجلد bootstrap\cache

  4. بتاريخ منذ ساعة مضت قال Wael Aljamal:

    هل من الممكن انك تطلب رابط خطأ؟ حاول Domain/public/index.php

    نفس المشكلة أخي 

    ملف الـ index.php موجود على المسار public_html/index.php كما فيlocalhost  htdocs/Project/index.php

  5. بتاريخ منذ ساعة مضت قال Wael Aljamal:

    تأكد من عدم وجود فراغات في بيانات الملف env. يمكنك إرفاق محتواه للتأكد من ذلك. ولا تنسى تحديد APP_URL يحوي دومين التطبيق

    تم التحقق من ملف env. لا توجد اي فراغات والـ APP_URL بها الدومين

    cPanel-Errors

    cPanel-Errors.thumb.png.f4d96054a2f792050a6aa90d4759133b.png

  6. بتاريخ 1 ساعة قال Ziyad Hasan:

    اضف مستخدم لقاعده البيانات كما في الصوره و ثم ضع بيانات المستخدم في ملف env.

    Capture1.PNG

    طبعا اخي تم إنشاء قاعده بيانات وإضافة بياناتها بملف env. بعدما قمت برفع ملفات الموقع على cpanel 

  7. بتاريخ منذ ساعة مضت قال Ziyad Hasan:

    طبعا يجب وضع بيانات القاعده في env. واترك ملف database.php كما كان في localhost

    للأسف قمت بالتعديل على ملف env. واعدت التعديل على ملف database.php كما كان على loclhost ولا تزال نفس المشكلة الموقع لا يعمل

    This page isn’t working is currently unable to handle this request. HTTP ERROR 500

  8. بتاريخ 15 ساعات قال Ziyad Hasan:
    • اولا انقل ملف index.php لمجلد public وضع به هذا الكود
      
      <?php
      
      /**
       * Laravel - A PHP Framework For Web Artisans
       *
       * @package  Laravel
       * @author   Taylor Otwell <taylor@laravel.com>
       */
      
      define('LARAVEL_START', microtime(true));
      
      /*
      |--------------------------------------------------------------------------
      | Register The Auto Loader
      |--------------------------------------------------------------------------
      |
      | Composer provides a convenient, automatically generated class loader for
      | our application. We just need to utilize it! We'll simply require it
      | into the script here so that we don't have to worry about manual
      | loading any of our classes later on. It feels great to relax.
      |
      */
      
      require __DIR__.'/../vendor/autoload.php';
      
      /*
      |--------------------------------------------------------------------------
      | Turn On The Lights
      |--------------------------------------------------------------------------
      |
      | We need to illuminate PHP development, so let us turn on the lights.
      | This bootstraps the framework and gets it ready for use, then it
      | will load up this application so that we can run it and send
      | the responses back to the browser and delight our users.
      |
      */
      
      $app = require_once __DIR__.'/../bootstrap/app.php';
      
      /*
      |--------------------------------------------------------------------------
      | Run The Application
      |--------------------------------------------------------------------------
      |
      | Once we have the application, we can handle the incoming request
      | through the kernel, and send the associated response back to
      | the client's browser allowing them to enjoy the creative
      | and wonderful application we have prepared for them.
      |
      */
      
      $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
      
      $response = $kernel->handle(
          $request = Illuminate\Http\Request::capture()
      );
      
      $response->send();
      
      $kernel->terminate($request, $response);

      ثم ضع هذا الكود في ملف htaccess. 

      
      <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteRule ^(.*)$ public/$1 [L]
      </IfModule>

       

     

    لا يعمل أخي جربت اضافة الكود في ملف htaccess ونقل ملف index.php لمجلد public

    عدلت على require __DIR__.'/../vendor/autoload.php'; و 

    $app = require_once __DIR__.'/../bootstrap/app.php';

    نفس المشكلة الخطأ السابق 403 Forbidden 

    هل من الضروري وضع بيانات القاعدة في .env ام ملف فقط في ملف database.php الموجود داخل مجلد config ?

  9. بتاريخ منذ ساعة مضت قال Ziyad Hasan:

    ارفع صوره لتوضح ما بداخل مجلد public  و صوره اخري لمجلد public_html 

    ما بداخل مجلد public_html علما انني اعدت ملف index.php الى مكانه public_html 

    cPanel-File-Manager-v3.thumb.png.90cea5969355f67f4c9ddc3462a103e6.png

    ما بداخل public

    cPanel-File-Manager-v4.thumb.png.d81f187482963844e3853411f7b7be9e.png

  10. بتاريخ منذ ساعة مضت قال Ziyad Hasan:

    انقل ملف index.php الي مجلد public

    بعد اضافة الكود تظهر نفس المشكلة خطأ Internal Server Error قمت بإعادته كما كان

    لكن بعدما تركت ملف index.php بملف الـ public واعادة محتوى .htaccess كما كان

    تظهر رسالة أخرى 403 Forbidden

     

    403-Forbidden.png

  11. بتاريخ منذ ساعة مضت قال Ziyad Hasan:

    نعم

    الكود لا يعمل أخي تظهر رسالة 

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator at webmaster@info.com to inform them of the time this error occurred, and the actions you performed just before this error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

  12. بتاريخ منذ ساعة مضت قال Ziyad Hasan:

    اسهل طريقه ان تترك كل ملف في مكانه و تقوم بوضع جميع ملفات المشروع في public_html ثم تقوم بانشاء ملف جديد htaccess. داخل المجلد public_html وتضع به هذا الكود 

    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^(.*)$ public/$1 [L]
    </IfModule

     

    أهلا بك أخي,

    لكن ملف  .htaccess موجود سابقا بالـ public_html 

    هل أقوم بستبدال ما بداخل htaccess بهدا الكود ?

  13. السلام عليكم عليكم ورحمة لله

    اخواني الكرام لدي مشكلة بعدما نقلت مشروع لارافيل من سيرفر محلي الى استضافة cpanel الموقع لم يشتغل  بعدما رفعت الملفات واستوردت قاعدة البيانات

    لا اعرف السبب ولا مصدر المشكلة ? 

     

    الخطوات التي قمت بتنفيذها

    1. قمت برفع ملف المشروع مضغوط بالـ zip حجمه حوالي 630 ميجا الى public_html كما هو بمجلد مشروع لارافيل بالـ localhost 
    2. غيرت بيانات ملف قاعدة البيانات database.php الموجود داخل ملف config 
    3. استوردت قاعدة البيانات القديمة من خلال phpMyAdmin

     

    بعدما قمت بتنفيذ هذه الخطوات وبعد دخول الى رابط الموقع تظهر رسالة خطأ HTTP ERROR 500 

    This page isn’t Domain.com is currently unable to handle this request.
    HTTP ERROR 500

     

    لم اعدل على ملف index.php الموجود بالـ public_html/index.php لأنني اراه انه لا يحتاج الى تعديل 

    <?php
    
    /**
     * Laravel - A PHP Framework For Web Artisans
     *
     * @package  Laravel
     * @author   Taylor Otwell <taylor@laravel.com>
     */
    
    define('LARAVEL_START', microtime(true));
    
    /*
    |--------------------------------------------------------------------------
    | Register The Auto Loader
    |--------------------------------------------------------------------------
    |
    | Composer provides a convenient, automatically generated class loader for
    | our application. We just need to utilize it! We'll simply require it
    | into the script here so that we don't have to worry about manual
    | loading any of our classes later on. It feels great to relax.
    |
    */
    
    require __DIR__.'/vendor/autoload.php';
    
    /*
    |--------------------------------------------------------------------------
    | Turn On The Lights
    |--------------------------------------------------------------------------
    |
    | We need to illuminate PHP development, so let us turn on the lights.
    | This bootstraps the framework and gets it ready for use, then it
    | will load up this application so that we can run it and send
    | the responses back to the browser and delight our users.
    |
    */
    
    $app = require_once __DIR__.'/bootstrap/app.php';
    
    /*
    |--------------------------------------------------------------------------
    | Run The Application
    |--------------------------------------------------------------------------
    |
    | Once we have the application, we can handle the incoming request
    | through the kernel, and send the associated response back to
    | the client's browser allowing them to enjoy the creative
    | and wonderful application we have prepared for them.
    |
    */
    
    $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
    
    $response = $kernel->handle(
        $request = Illuminate\Http\Request::capture()
    );
    
    $response->send();
    
    $kernel->terminate($request, $response);

     

    للإطلاع على ملف .htaccess الموجود بالـ public_html

    <IfModule mod_rewrite.c>
        <IfModule mod_negotiation.c>
            Options -MultiViews -Indexes
        </IfModule>
    
        RewriteEngine On
    
        # Handle Authorization Header
        RewriteCond %{HTTP:Authorization} .
        RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
        # Redirect Trailing Slashes If Not A Folder...
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_URI} (.+)/$
        RewriteRule ^ %1 [L,R=301]
    
        # Handle Front Controller...
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^ index.php [L]
    </IfModule>
    
    # Disable index view
    Options -Indexes
    
    # Hide a specific file
    <Files .env>
        Order allow,deny
        Deny from all
    </Files>
    
    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
        ExpiresActive On
        ExpiresByType image/jpg "access plus 1 year"
        ExpiresByType image/jpeg "access plus 1 year"
        ExpiresByType image/gif "access plus 1 year"
        ExpiresByType image/png "access plus 1 year"
        ExpiresByType text/x-javascript "access plus 1 month"
        ExpiresByType application/x-shockwave-flash "access plus 1 month"
        ExpiresByType image/x-icon "access plus 1 year"
        ExpiresDefault "access plus 1 days"
    </IfModule>

     

     

×
×
  • أضف...