chamilo / chamilo-lms

Chamilo is a learning management system focused on ease of use and accessibility
https://chamilo.org
GNU General Public License v3.0
807 stars 481 forks source link

Error fatal de PHP en /main/inc/lib/database.constants.inc.php en la instalación #2403

Closed linkmoises closed 4 years ago

linkmoises commented 6 years ago

Current behavior / Resultado actual / Résultat actuel

Al iniciar la instalación se obtiene un error fatal que no permite avanzar.

`Warning: require_once(//main/inc/lib/database.constants.inc.php): failed to open stream: No such file or directory in /var/www/html/main/install/index.php on line 44

Fatal error: require_once(): Failed opening required '//main/inc/lib/database.constants.inc.php' (include_path='.:/usr/share/php') in /var/www/html/main/install/index.php on line 44`

Expected behavior / Resultado esperado / Résultat attendu

Que la instalación continúe normalmente.

Steps to reproduce / Pasos para reproducir / Étapes pour reproduire

Instalación nueva de Debian 9.3 x64, nginx 1.10.3, php 7.0.27. MariaDB se encuentra en otro servidor de la misma red y otra instalación de Chamilo 1.10.6 en un servidor de la misma red funcionando sin problemas. Se siguieron las recomendaciones de beeznest para la instalación.

Chamilo Version / Versión de Chamilo / Version de Chamilo

He reproducido el error con la versión 1.11.6 para php7, 1.11.6 para php5 y 1.11.4.

ywarnier commented 6 years ago

Hola @linkmoises, el error parece decir que falta la definición de la ruta hacia la base de tu instalación de Chamilo... no tiene que ver con la base de datos porque falla al tratar de acceder al archivo /var/www/html/main/inc/lib/database.constants.inc.php. Podrías verificar si este archivo se encuentra en esta carpeta? De no ser el caso, podrías confirmar si subiste los archivos ya desomprimidos via FTP?

A veces FTP, dentro de la larga lista de archivos que transferir, tiene problemas para subirlos todos. Se recomienda subir el archivo de instalación comprimido y luego descomprimirlo en el mismo servidor.

linkmoises commented 6 years ago

Hola @ywarnier si, en efecto descargue el mismo zip y el tarball desde el servidor usando wget y los extraje desde el sitio de instalación.

Acá el contenido de main/install

/var/www/html/main/install$ ls -l total 376 -rw-r--r-- 1 www-data www-data 2213 Feb 22 16:18 ajax.php -rwxr-xr-x 1 www-data www-data 34111 Feb 22 16:19 configuration.dist.php -rw-r--r-- 1 www-data www-data 125395 Feb 22 16:18 data.sql -rwxr-xr-x 1 www-data www-data 1194 Feb 22 16:18 htaccess.dist -rwxr-xr-x 1 www-data www-data 50183 Feb 22 16:18 index.php -rwxr-xr-x 1 www-data www-data 2017 Feb 22 16:18 install_files.inc.php -rwxr-xr-x 1 www-data www-data 130986 Feb 22 16:18 install.lib.php drwxr-xr-x 2 www-data www-data 4096 Feb 22 16:18 profiles -rwxr-xr-x 1 www-data www-data 3064 Feb 22 16:18 update-configuration.inc.php -rw-r--r-- 1 www-data www-data 2514 Feb 22 16:18 update-files-1.10.0-1.11.0.inc.php -rw-r--r-- 1 www-data www-data 6831 Feb 22 16:18 update-files-1.9.0-1.10.0.inc.php -rwxr-xr-x 1 www-data www-data 715 Feb 22 16:18 version.php

y la carpeta main/inc/lib

/var/www/html/main/inc/lib$ ls -l total 5212 -rwxr-xr-x 1 www-data www-data 2359 Feb 22 16:18 access_url_edit_courses_to_url_functions.lib.php -rwxr-xr-x 1 www-data www-data 2185 Feb 22 16:18 access_url_edit_sessions_to_url_functions.lib.php -rwxr-xr-x 1 www-data www-data 2574 Feb 22 16:18 access_url_edit_users_to_url_functions.lib.php -rwxr-xr-x 1 www-data www-data 63469 Feb 22 16:19 add_course.lib.inc.php -rwxr-xr-x 1 www-data www-data 6563 Feb 22 16:18 add_courses_to_session_functions.lib.php -rw-r--r-- 1 www-data www-data 153657 Feb 22 16:18 agenda.lib.php -rw-r--r-- 1 www-data www-data 11278 Feb 22 16:19 AnnouncementEmail.php -rwxr-xr-x 1 www-data www-data 75634 Feb 22 16:19 AnnouncementManager.php -rw-r--r-- 1 www-data www-data 289724 Feb 22 16:19 api.lib.php -rwxr-xr-x 1 www-data www-data 2648 Feb 22 16:18 app_view.php -rwxr-xr-x 1 www-data www-data 3086 Feb 22 16:18 array.lib.php -rwxr-xr-x 1 www-data www-data 79820 Feb 22 16:18 attendance.lib.php -rwxr-xr-x 1 www-data www-data 32378 Feb 22 16:18 auth.lib.php -rw-r--r-- 1 www-data www-data 6060 Feb 22 16:18 baker.lib.php -rwxr-xr-x 1 www-data www-data 37064 Feb 22 16:18 banner.lib.php -rwxr-xr-x 1 www-data www-data 126208 Feb 22 16:18 blog.lib.php drwxr-xr-x 2 www-data www-data 4096 Feb 22 16:18 browser -rwxr-xr-x 1 www-data www-data 24951 Feb 22 16:18 career.lib.php -rwxr-xr-x 1 www-data www-data 28392 Feb 22 16:19 certificate.lib.php -rwxr-xr-x 1 www-data www-data 4300 Feb 22 16:18 chamilo_session.class.php -rwxr-xr-x 1 www-data www-data 14800 Feb 22 16:18 chat.lib.php -rwxr-xr-x 1 www-data www-data 1484 Feb 22 16:18 conditional_login.class.php -rwxr-xr-x 1 www-data www-data 42022 Feb 22 16:19 course_category.lib.php -rw-r--r-- 1 www-data www-data 25081 Feb 22 16:18 CourseChatUtils.php -rwxr-xr-x 1 www-data www-data 17501 Feb 22 16:18 course_description.lib.php -rwxr-xr-x 1 www-data www-data 75213 Feb 22 16:19 course_home.lib.php -rwxr-xr-x 1 www-data www-data 247034 Feb 22 16:18 course.lib.php -rwxr-xr-x 1 www-data www-data 29285 Feb 22 16:18 course_request.lib.php -rw-r--r-- 1 www-data www-data 1595 Feb 22 16:18 CoursesAndSessionsCatalog.class.php -rwxr-xr-x 1 www-data www-data 2785 Feb 22 16:18 custom_pages.class.php -rwxr-xr-x 1 www-data www-data 21743 Feb 22 16:18 dashboard.lib.php -rwxr-xr-x 1 www-data www-data 14341 Feb 22 16:18 database.constants.inc.php -rwxr-xr-x 1 www-data www-data 23409 Feb 22 16:18 database.lib.php -rw-r--r-- 1 www-data www-data 102 Feb 22 16:18 database.mysqli.lib.php -rwxr-xr-x 1 www-data www-data 27126 Feb 22 16:18 diagnoser.lib.php -rwxr-xr-x 1 www-data www-data 89942 Feb 22 16:19 display.lib.php -rw-r--r-- 1 www-data www-data 266800 Feb 22 16:19 document.lib.php drwxr-xr-x 2 www-data www-data 4096 Feb 22 16:18 elfinder -rwxr-xr-x 1 www-data www-data 3717 Feb 22 16:18 event_email_template.class.php -rwxr-xr-x 1 www-data www-data 2022 Feb 22 16:18 events_dispatcher.class.php -rwxr-xr-x 1 www-data www-data 11606 Feb 22 16:18 events_email.class.php -rw-r--r-- 1 www-data www-data 83388 Feb 22 16:18 events.lib.php -rw-r--r-- 1 www-data www-data 181396 Feb 22 16:19 exercise.lib.php -rwxr-xr-x 1 www-data www-data 18313 Feb 22 16:19 exercise_show_functions.lib.php -rwxr-xr-x 1 www-data www-data 12092 Feb 22 16:19 export.lib.inc.php -rwxr-xr-x 1 www-data www-data 137205 Feb 22 16:18 extra_field.lib.php -rwxr-xr-x 1 www-data www-data 30461 Feb 22 16:18 extra_field_option.lib.php -rwxr-xr-x 1 www-data www-data 42265 Feb 22 16:18 extra_field_value.lib.php -rwxr-xr-x 1 www-data www-data 5342 Feb 22 16:18 fileDisplay.lib.php -rwxr-xr-x 1 www-data www-data 9458 Feb 22 16:18 fileManage.lib.php -rwxr-xr-x 1 www-data www-data 69082 Feb 22 16:19 fileUpload.lib.php -rw-r--r-- 1 www-data www-data 4343 Feb 22 16:18 fixlinks.js drwxr-xr-x 2 www-data www-data 4096 Feb 22 16:18 flv_player drwxr-xr-x 4 www-data www-data 4096 Feb 22 16:19 formvalidator drwxr-xr-x 2 www-data www-data 4096 Feb 22 16:18 freemindflashbrowser -rw-r--r-- 1 www-data www-data 5877 Feb 22 16:18 GamificationUtils.php -rwxr-xr-x 1 www-data www-data 16247 Feb 22 16:18 geometry.lib.php -rwxr-xr-x 1 www-data www-data 27038 Feb 22 16:18 glossary.lib.php -rwxr-xr-x 1 www-data www-data 6916 Feb 22 16:18 gradebook.lib.php -rwxr-xr-x 1 www-data www-data 10719 Feb 22 16:18 grade_model.lib.php -rwxr-xr-x 1 www-data www-data 104093 Feb 22 16:18 groupmanager.lib.php drwxr-xr-x 3 www-data www-data 4096 Feb 22 16:18 hook -rwxr-xr-x 1 www-data www-data 17203 Feb 22 16:18 image.lib.php -rwxr-xr-x 1 www-data www-data 1988 Feb 22 16:19 import.lib.php -rwxr-xr-x 1 www-data www-data 44 Feb 22 16:18 index.html drwxr-xr-x 6 www-data www-data 4096 Feb 22 16:18 internationalization_database -rwxr-xr-x 1 www-data www-data 90106 Feb 22 16:18 internationalization.lib.php drwxr-xr-x 33 www-data www-data 4096 Feb 22 16:18 javascript drwxr-xr-x 5 www-data www-data 4096 Feb 22 16:18 kses-0.2.2 -rwxr-xr-x 1 www-data www-data 11567 Feb 22 16:18 legal.lib.php -rwxr-xr-x 1 www-data www-data 70264 Feb 22 16:19 link.lib.php -rwxr-xr-x 1 www-data www-data 36356 Feb 22 16:19 login.lib.php -rwxr-xr-x 1 www-data www-data 2219 Feb 22 16:18 login_redirection.class.php -rwxr-xr-x 1 www-data www-data 4765 Feb 22 16:18 lp_item.lib.php drwxr-xr-x 3 www-data www-data 4096 Feb 22 16:18 mediaplayer -rwxr-xr-x 1 www-data www-data 80193 Feb 22 16:19 message.lib.php drwxr-xr-x 2 www-data www-data 4096 Feb 22 16:18 mimetex -rwxr-xr-x 1 www-data www-data 6327 Feb 22 16:18 model.lib.php -rw-r--r-- 1 www-data www-data 44070 Feb 22 16:18 MoodleImport.php -rw-r--r-- 1 www-data www-data 129851 Feb 22 16:18 myspace.lib.php drwxr-xr-x 2 www-data www-data 4096 Feb 22 16:18 nanogong -rwxr-xr-x 1 www-data www-data 10515 Feb 22 16:18 notebook.lib.php -rw-r--r-- 1 www-data www-data 19937 Feb 22 16:18 notification.lib.php drwxr-xr-x 2 www-data www-data 4096 Feb 22 16:18 nusoap -rwxr-xr-x 1 www-data www-data 18608 Feb 22 16:18 online.inc.php drwxr-xr-x 2 www-data www-data 4096 Feb 22 16:18 opengraph -rwxr-xr-x 1 www-data www-data 36762 Feb 22 16:19 pdf.lib.php drwxr-xr-x 7 www-data www-data 4096 Feb 22 16:18 pear drwxr-xr-x 3 www-data www-data 4096 Feb 22 16:18 phpmailer drwxr-xr-x 6 www-data www-data 4096 Feb 22 16:18 phpseclib -rwxr-xr-x 1 www-data www-data 29813 Feb 22 16:19 plugin.class.php -rwxr-xr-x 1 www-data www-data 21068 Feb 22 16:18 plugin.lib.php -rwxr-xr-x 1 www-data www-data 15798 Feb 22 16:18 portfolio.class.php drwxr-xr-x 2 www-data www-data 4096 Feb 22 16:18 ppt2png -rwxr-xr-x 1 www-data www-data 9283 Feb 22 16:18 promotion.lib.php -rwxr-xr-x 1 www-data www-data 6005 Feb 22 16:18 redirect.class.php -rw-r--r-- 1 www-data www-data 12648 Feb 22 16:18 ScheduledAnnouncement.php drwxr-xr-x 4 www-data www-data 4096 Feb 22 16:18 search -rwxr-xr-x 1 www-data www-data 19906 Feb 22 16:18 security.lib.php -rw-r--r-- 1 www-data www-data 110 Feb 22 16:18 SequenceManager.php -rw-r--r-- 1 www-data www-data 3513 Feb 22 16:18 SequenceResourceManager.php -rwxr-xr-x 1 www-data www-data 342056 Feb 22 16:19 sessionmanager.lib.php -rwxr-xr-x 1 www-data www-data 72032 Feb 22 16:19 skill.lib.php -rwxr-xr-x 1 www-data www-data 6754 Feb 22 16:18 skill.visualizer.lib.php -rw-r--r-- 1 www-data www-data 1219 Feb 22 16:18 SmsPluginLibraryInterface.php -rw-r--r-- 1 www-data www-data 5594 Feb 22 16:18 SmsPlugin.php -rwxr-xr-x 1 www-data www-data 81692 Feb 22 16:18 social.lib.php -rwxr-xr-x 1 www-data www-data 42011 Feb 22 16:18 sortable_table.class.php -rwxr-xr-x 1 www-data www-data 9170 Feb 22 16:18 specific_fields_manager.lib.php -rw-r--r-- 1 www-data www-data 42284 Feb 22 16:18 statistics.lib.php -rw-r--r-- 1 www-data www-data 17526 Feb 22 16:18 sub_language.class.php -rwxr-xr-x 1 www-data www-data 3806 Feb 22 16:18 surveymanager.lib.php drwxr-xr-x 3 www-data www-data 4096 Feb 22 16:18 svg-edit drwxr-xr-x 3 www-data www-data 4096 Feb 22 16:18 swfobject drwxr-xr-x 3 www-data www-data 4096 Feb 22 16:18 system -rwxr-xr-x 1 www-data www-data 33801 Feb 22 16:18 system_announcements.lib.php -rwxr-xr-x 1 www-data www-data 11231 Feb 22 16:18 table_sort.class.php -rwxr-xr-x 1 www-data www-data 43 Feb 22 16:18 tablesort.lib.php -rw-r--r-- 1 www-data www-data 2836 Feb 22 16:18 TeacherTimeReport.php -rwxr-xr-x 1 www-data www-data 59639 Feb 22 16:18 template.lib.php -rwxr-xr-x 1 www-data www-data 32182 Feb 22 16:19 text.lib.php -rwxr-xr-x 1 www-data www-data 57066 Feb 22 16:18 thematic.lib.php -rw-r--r-- 1 www-data www-data 81976 Feb 22 16:19 TicketManager.php -rwxr-xr-x 1 www-data www-data 8849 Feb 22 16:18 timeline.lib.php -rwxr-xr-x 1 www-data www-data 311048 Feb 22 16:18 tracking.lib.php -rwxr-xr-x 1 www-data www-data 39701 Feb 22 16:18 urlmanager.lib.php -rwxr-xr-x 1 www-data www-data 3377 Feb 22 16:18 user_api_key_manager.class.php -rwxr-xr-x 1 www-data www-data 87485 Feb 22 16:19 usergroup.lib.php -rwxr-xr-x 1 www-data www-data 213034 Feb 22 16:19 usermanager.lib.php -rwxr-xr-x 1 www-data www-data 110590 Feb 22 16:18 userportal.lib.php -rw-r--r-- 1 www-data www-data 2455 Feb 22 16:18 VideoChat.php drwxr-xr-x 2 www-data www-data 4096 Feb 22 16:18 wami-recorder drwxr-xr-x 2 www-data www-data 4096 Feb 22 16:19 webservices drwxr-xr-x 3 www-data www-data 4096 Feb 22 16:18 xajax drwxr-xr-x 2 www-data www-data 4096 Feb 22 16:18 zombie

ywarnier commented 6 years ago

Bien, entonces regresamos al otro problema: el instalador no encuentra la ruta de tu archivo database.constants:

Warning: require_once(//main/inc/lib/database.constants.inc.php): failed to open stream: No such file or directory in /var/www/html/main/install/index.php on line 44

Es interesante porque por alguna razón te da la buena ruta para /var/www/html/main/install/index.php pero para //main/inc/lib/database.constants.inc.php le falta el document root.

Tienes a la mano la configuración de tu VirtualHost de Apache? Aquí: "//main/inc/lib..." debería venir "/var/www/html/main/inc/lib...". Si no lo encuentra es que algo está mal...

linkmoises commented 6 years ago

Estoy utilizando nginx 1.10.3 y php 7.0.27. Este es el server block de nginx

server {
    listen   80;
    server_name  beta.grupomedicopanama.com;

    access_log  /var/log/nginx/beta.grupomedicopanama.com.access.log;
    error_log /var/log/nginx/beta.grupomedicopanama.com.error.log;
    root   /var/www/html/;
    index  index.php index.html;

    location @rewrite{
        rewrite ^certificates/$ certificates/index.php last;
    rewrite ^/courses/([^/]+)/$ /main/course_home/course_home.php?cDir=$1 last;
    rewrite ^/courses/([^/]+)/index.php$ /main/course_home/course_home.php?cDir=$1 last;
    rewrite ^/courses/([^/]+)/scorm/(.*)$ /main/document/download_scorm.php?doc_url=/$2&cDir=$1 last;
    # Alternatively, you can choose to give direct access to all SCORM files, which is much faster but less secure
    # rewrite "^/courses/([^/]+)/scorm/(.*)$" /app/courses/$1/scorm/$2 break;

    rewrite "^/courses/([^/]+)/document/certificates/(.*)$" /app/courses/$1/document/certificates/$2 last;
    rewrite ^/courses/([^/]+)/document/(.*)$ /main/document/download.php?doc_url=/$2&cDir=$1 last;
    rewrite ^/courses/([^/]+)/upload/([^/]+)/(.*)$ /main/document/download_uploaded_files.php?code=$1&type=$2&file=$3 last;
    rewrite ^/courses/([^/]+)/work/(.*)$ /main/work/download.php?file=work/$2&cDir=$1 last;
    rewrite ^/courses/([^/]+)/(.*)$ /app/courses/$1/$2 last;
    rewrite ^/session/([^/]+)/about/?$ /main/session/about.php?session_id=$1 last;
    rewrite ^/badge/(\d+) /main/badge/issued.php?issue=$1 last;
    rewrite ^/skill/(\d+)/user/(\d+)$ /main/badge/issued_all.php?skill=$1&user=$2 last;
    rewrite ^/badge/(\d+)/user/(\d+)$ /main/badge/issued_all.php?skill=$1&user=$2 last;
    rewrite ^/main/exercice/(.*)$ /main/exercise/$1 last;
    rewrite ^/main/newscorm/(.*)$ /main/lp/$1 last;
    rewrite ^/service/(\d+)$ /plugin/buycourses/src/service_information.php?service_id=$1 last;
    rewrite "^/main/upload/users/(.*)/(.*)/my_files/(.*)$" /app/upload/users/$1/$2/my_files/$3 last;

    try_files $uri /index.php$is_args$args;
    break;
  }

  location / {
    rewrite ^/courses/([^/]+)/$ /main/course_home/course_home.php?cDir=$1 last;
    rewrite ^/courses/([^/]+)/index.php$ /main/course_home/course_home.php?cDir=$1 last;
    rewrite ^/skill/(\d+)/user/(\d+)$ /main/badge/issued_all.php?skill=$1&user=$2 last;
    rewrite ^/badge/(\d+)/user/(\d+)$ /main/badge/issued_all.php?skill=$1&user=$2 last;
    try_files $uri @rewrite;
  }

  location /main {
    rewrite ^/main/admin/$ /main/admin/index.php last;
  }

  location ~ \.php$ {
    client_max_body_size 20M;
    #try_files $uri /index.php$is_args$args;

    rewrite ^/certificates/$ /certificates/index.php?id=%1  last;
    rewrite ^/courses/([^/]+)/$ /main/course_home/course_home.php?cDir=$1 last;
    rewrite ^/courses/([^/]+)/index.php$ /main/course_home/course_home.php?cDir=$1 last;
    rewrite ^/session/([^/]+)/about/?$ /main/session/about.php?session_id=$1 last;
    rewrite ^/badge/([^/]+) /main/badge/issued.php?issue=$1 last;
    rewrite ^/main/exercice/(.+)$ /main/exercise/$1 last;
    rewrite ^/main/newscorm/(.+)$ /main/lp/$1 last;

    include snippets/fastcgi-php.conf;
    fastcgi_pass 127.0.0.1:9000;

  }

  # Serve static files directly
  location ~* \.(png|jpe?g|gif|ico|js|css|mp3|swf|flv|mp4|ogg)$ {
    expires 1y;
    access_log off;
    rewrite ^/courses/([^/]+)/course-pic85x85.png$ /app/courses/$1/course-pic85x85.png last;
    rewrite ^/courses/([^/]+)/course-pic.png$ /app/courses/$1/course-pic.png last;
    rewrite ^/courses/([^/]+)/scorm/(.*)$ /main/document/download_scorm.php?doc_url=/$2&cDir=$1 last;
    rewrite ^/courses/([^/]+)/document/(.*)$ /main/document/download.php?doc_url=/$2&cDir=$1 last;
    rewrite ^/courses/([^/]+)/work/(.*)$ /main/work/download.php?file=work/$2&cDir=$1 last;
    rewrite ^/courses/([^/]+)/upload/(.*)$ /app/courses/$1/upload/$2 last;
    # For all these media resources not treated by previous rewrites, give direct access (no permission check)
    rewrite ^/courses/(.*)$ /app/courses/$1 break;
    try_files $uri @rewrite;
  }

  location ~ ~\.(ht|git){
    deny all;
  }

  location ^~ /tests/ {
    deny all;
  }
}
ywarnier commented 6 years ago

@linkmoises resolver este problema requeriría acceso a tu servidor, y no hacemos esto como soporte de comunidad (porque preferimos concentrarnos en problemas que afectan todo el mundo). Para esto existen los proveedores oficiales de Chamilo que puedes contactar aquí: https://chamilo.org/providers

jelondono commented 5 years ago

Estoy utilizando nginx 1.10.3 y php 7.0.27. Este es el server block de nginx

server {
  listen   80;
  server_name  beta.grupomedicopanama.com;

  access_log  /var/log/nginx/beta.grupomedicopanama.com.access.log;
  error_log /var/log/nginx/beta.grupomedicopanama.com.error.log;
  root   /var/www/html/;
  index  index.php index.html;

  location @rewrite{
      rewrite ^certificates/$ certificates/index.php last;
    rewrite ^/courses/([^/]+)/$ /main/course_home/course_home.php?cDir=$1 last;
    rewrite ^/courses/([^/]+)/index.php$ /main/course_home/course_home.php?cDir=$1 last;
    rewrite ^/courses/([^/]+)/scorm/(.*)$ /main/document/download_scorm.php?doc_url=/$2&cDir=$1 last;
    # Alternatively, you can choose to give direct access to all SCORM files, which is much faster but less secure
    # rewrite "^/courses/([^/]+)/scorm/(.*)$" /app/courses/$1/scorm/$2 break;

    rewrite "^/courses/([^/]+)/document/certificates/(.*)$" /app/courses/$1/document/certificates/$2 last;
    rewrite ^/courses/([^/]+)/document/(.*)$ /main/document/download.php?doc_url=/$2&cDir=$1 last;
    rewrite ^/courses/([^/]+)/upload/([^/]+)/(.*)$ /main/document/download_uploaded_files.php?code=$1&type=$2&file=$3 last;
    rewrite ^/courses/([^/]+)/work/(.*)$ /main/work/download.php?file=work/$2&cDir=$1 last;
    rewrite ^/courses/([^/]+)/(.*)$ /app/courses/$1/$2 last;
    rewrite ^/session/([^/]+)/about/?$ /main/session/about.php?session_id=$1 last;
    rewrite ^/badge/(\d+) /main/badge/issued.php?issue=$1 last;
    rewrite ^/skill/(\d+)/user/(\d+)$ /main/badge/issued_all.php?skill=$1&user=$2 last;
    rewrite ^/badge/(\d+)/user/(\d+)$ /main/badge/issued_all.php?skill=$1&user=$2 last;
    rewrite ^/main/exercice/(.*)$ /main/exercise/$1 last;
    rewrite ^/main/newscorm/(.*)$ /main/lp/$1 last;
    rewrite ^/service/(\d+)$ /plugin/buycourses/src/service_information.php?service_id=$1 last;
    rewrite "^/main/upload/users/(.*)/(.*)/my_files/(.*)$" /app/upload/users/$1/$2/my_files/$3 last;

    try_files $uri /index.php$is_args$args;
    break;
  }

  location / {
    rewrite ^/courses/([^/]+)/$ /main/course_home/course_home.php?cDir=$1 last;
    rewrite ^/courses/([^/]+)/index.php$ /main/course_home/course_home.php?cDir=$1 last;
    rewrite ^/skill/(\d+)/user/(\d+)$ /main/badge/issued_all.php?skill=$1&user=$2 last;
    rewrite ^/badge/(\d+)/user/(\d+)$ /main/badge/issued_all.php?skill=$1&user=$2 last;
    try_files $uri @rewrite;
  }

  location /main {
    rewrite ^/main/admin/$ /main/admin/index.php last;
  }

  location ~ \.php$ {
    client_max_body_size 20M;
    #try_files $uri /index.php$is_args$args;

    rewrite ^/certificates/$ /certificates/index.php?id=%1  last;
    rewrite ^/courses/([^/]+)/$ /main/course_home/course_home.php?cDir=$1 last;
    rewrite ^/courses/([^/]+)/index.php$ /main/course_home/course_home.php?cDir=$1 last;
    rewrite ^/session/([^/]+)/about/?$ /main/session/about.php?session_id=$1 last;
    rewrite ^/badge/([^/]+) /main/badge/issued.php?issue=$1 last;
    rewrite ^/main/exercice/(.+)$ /main/exercise/$1 last;
    rewrite ^/main/newscorm/(.+)$ /main/lp/$1 last;

    include snippets/fastcgi-php.conf;
    fastcgi_pass 127.0.0.1:9000;

  }

  # Serve static files directly
  location ~* \.(png|jpe?g|gif|ico|js|css|mp3|swf|flv|mp4|ogg)$ {
    expires 1y;
    access_log off;
    rewrite ^/courses/([^/]+)/course-pic85x85.png$ /app/courses/$1/course-pic85x85.png last;
    rewrite ^/courses/([^/]+)/course-pic.png$ /app/courses/$1/course-pic.png last;
    rewrite ^/courses/([^/]+)/scorm/(.*)$ /main/document/download_scorm.php?doc_url=/$2&cDir=$1 last;
    rewrite ^/courses/([^/]+)/document/(.*)$ /main/document/download.php?doc_url=/$2&cDir=$1 last;
    rewrite ^/courses/([^/]+)/work/(.*)$ /main/work/download.php?file=work/$2&cDir=$1 last;
    rewrite ^/courses/([^/]+)/upload/(.*)$ /app/courses/$1/upload/$2 last;
    # For all these media resources not treated by previous rewrites, give direct access (no permission check)
    rewrite ^/courses/(.*)$ /app/courses/$1 break;
    try_files $uri @rewrite;
  }

  location ~ ~\.(ht|git){
    deny all;
  }

  location ^~ /tests/ {
    deny all;
  }
}

Pudiste encontrar una respuesta?

disgregador commented 5 years ago

Si usas PHP 7.0 no te va a funcionar ya que Chamilo 1.11.10 se ha realizado para PHP 5.6, 7.1, 7.2 y 7.3. Revisa https://github.com/chamilo/chamilo-lms/releases Es aconsejable que no reabras issues tan antiguos. Mejor crea uno nuevo. Saludos.