xevidos / codiad

This is the Telaaedifex team's custom version of Codiad. Codiad is a web-based IDE framework with a small footprint and minimal requirements.
https://telaaedifex.com/codiad/
MIT License
10 stars 4 forks source link

install of development version on qnap nas fails #7

Closed ozett closed 4 years ago

ozett commented 4 years ago

old origianl codiad 2.8.x was installable on same plattform, but got issues with php. i tried today the development version but got errors. any hints?

Warning: require_once(absolute/path/to/codiad/components/permissions/class.permissions.php): failed to open stream: No such file or directory in /share/CACHEDEV2_DATA/Web/codiad/common.php on line 110

Fatal error: require_once(): Failed opening required 'absolute/path/to/codiad/components/permissions/class.permissions.php' (include_path='.:/etc/config/php') in /share/CACHEDEV2_DATA/Web/codiad/common.php on line 110

---add: 1) qnap runs: PHP Version 7.3.7 2) i can install ver 2.88, but not login 2) i can install ver 2.90, but not login 2) i can install ver 2.91, but not login

--add (i read until 292 no mysql required, great!!):

with 2.92 i can install, but no file-creation nor upload. (project-folder creation works), maybe owner-errors?

[/share/CACHEDEV2_DATA/Web/codiad/workspace/dg] # ls -la
total 16
drwxrwx--- 2 httpdusr administrators 4096 2020-03-02 09:59 ./
drwxrwxrwx 4 admin    administrators 4096 2020-03-02 09:57 ../
-rw-rw---- 1 httpdusr administrators    0 2020-03-02 09:59 123
[/share/CACHEDEV2_DATA/Web/codiad/workspace/dg] #

with 2.92 i got these error on install-page:

Warning: session_start(): open(absolute/path/to/codiad/data/sessions/sess_8e0c8c90e27a451ae7cf81cb1ffa9b89, O_RDWR) failed: No such file or directory (2) in /share/CACHEDEV2_DATA/Web/codiad/common.php on line 95

Warning: session_start(): Failed to read session data: files (path: absolute/path/to/codiad/data/sessions) in /share/CACHEDEV2_DATA/Web/codiad/common.php on line 95

Warning: include(absolute/path/to/codiad/languages/en.php): failed to open stream: No such file or directory in /share/CACHEDEV2_DATA/Web/codiad/common.php on line 110

Warning: include(): Failed opening 'absolute/path/to/codiad/languages/en.php' for inclusion (include_path='.:/etc/config/php') in /share/CACHEDEV2_DATA/Web/codiad/common.php on line 110

Warning: file_get_contents(absolute/path/to/codiad/components/filemanager/context_menu.json): failed to open stream: No such file or directory in /share/CACHEDEV2_DATA/Web/codiad/index.php on line 6

Warning: file_get_contents(absolute/path/to/codiad/components/right_bar.json): failed to open stream: No such file or directory in /share/CACHEDEV2_DATA/Web/codiad/index.php on line 10

Warning: scandir(absolute/path/to/codiad/components): failed to open dir: No such file or directory in /share/CACHEDEV2_DATA/Web/codiad/common.php on line 120

Warning: scandir(): (errno 2): No such file or directory in /share/CACHEDEV2_DATA/Web/codiad/common.php on line 120

Warning: Invalid argument supplied for foreach() in /share/CACHEDEV2_DATA/Web/codiad/common.php on line 121

Warning: scandir(absolute/path/to/codiad/plugins): failed to open dir: No such file or directory in /share/CACHEDEV2_DATA/Web/codiad/common.php on line 120

Warning: scandir(): (errno 2): No such file or directory in /share/CACHEDEV2_DATA/Web/codiad/common.php on line 120

Warning: Invalid argument supplied for foreach() in /share/CACHEDEV2_DATA/Web/codiad/common.php on line 121

Warning: scandir(absolute/path/to/codiad/themes): failed to open dir: No such file or directory in /share/CACHEDEV2_DATA/Web/codiad/common.php on line 120

Warning: scandir(): (errno 2): No such file or directory in /share/CACHEDEV2_DATA/Web/codiad/common.php on line 120

Warning: Invalid argument supplied for foreach() in /share/CACHEDEV2_DATA/Web/codiad/common.php on line 121
xevidos commented 4 years ago

Are you attempting to install a fresh instance or are you trying to upgrade an older instance? In addition does the user running the webserver have permission to write to both the folder codiad is installed in and the workspace directory?

Edit: In addition to the previous things could you make sure that the BASE_URL and BASE_PATH constants are defined correctly in your config.php?

ozett commented 4 years ago

hi, thanks for asking. i tried this on my qnap NAS with recent firmware.

1) drwxrwxrwx 4 admin administrators 4096 2020-03-02 09:57 ../ this is the user:group which can upload through smb-share the projectfiles.

2) if i run the install from the URL, i see a different user created files: -rw-rw---- 1 httpdusr administrators 0 2020-03-02 09:59 123

and the listed errors occurs.

i succesfully installed in the same environment icecoder.net, which looks like a working fork of codiad. i hat no error at all with this packet.

--edit: you asked: BASE_URL and BASE_PATH constants are defined correctly in your config.php? you mean before install - or after? toi do this manually is part of the install-routine?

xevidos commented 4 years ago

The two variables are usually set automatically when installing. However, if for some reason PHP can not get the correct directory they may not be set with the correct values. So after you install can you check those constants?

ozett commented 4 years ago

my findings are, that the codiad-web-directory seems a symlink dir, but its somehow working with errors in vers 2.92. (i love to have a lightweight editor without mysql needs) ...

image

ozett commented 4 years ago

i cannot create files in the first projectfolder, but i can create another projectfolder image

xevidos commented 4 years ago

Could you change a couple lines in common.php.

On or around line 35, there should be a few lines like below:

Change: $path = str_replace("index.php", "", $_SERVER['SCRIPT_FILENAME']); To: $path = getcwd() . '/';

And remove: $path = substr($_SERVER['SCRIPT_FILENAME'],0, strpos($_SERVER['SCRIPT_FILENAME'], $folder));

After you do this could you let me know if any different errors show up?

ozett commented 4 years ago

i changed the code as you told me: image

and got this: image

xevidos commented 4 years ago

Is there a folder named sessions under the data folder? Also can you do a var_dump( getcwd(), __DIR__ ); to see what it returns.

ozett commented 4 years ago

i will check in approx 2 hrs later from here. i will report...

ozett commented 4 years ago

YES, there is a sessions folder with a file. What now?

image

ozett commented 4 years ago

dont know exactly how to to this "getcwd".....need some help...

image

xevidos commented 4 years ago

As in could you put var_dump( getcwd(), __DIR__, $_SERVER["SCRIPT_FILENAME"] ); in common.php above the line where you put $path = getcwd() . '/';

It seems like from the messages on the home page the program is not able to load the config file with the correct paths. It uses a default path called absolute/path/to/codaid/ ... instead which doesn't exist.

ozett commented 4 years ago

i put the line. still path-errors... image

ozett commented 4 years ago

on my webspace this path exist:

symlink: /share/Web/xevidos abs-path: /share/CACHEDEV2_DATA/Web/xevidos

but i dont know, where to put now/correct the full the absolut-path . common.php? config.php? sessions? could symlinks not be tested on install?

image

xevidos commented 4 years ago

Okay,

Lets try a few different things.

  1. First, get rid of the var_dump in common.php
  2. Second, in config.php change the BASE_PATH to the full path instead of the symlink ( /share/CACHEDEV2_DATA/Web/xevidos )
ozett commented 4 years ago

i have done this 2 thing, now the loging has no more errors - but does nothing image

ozett commented 4 years ago

i did a fresh deployment of ver2.9.2.zip to a new directory. this is the fresh startscreen:

image

ozett commented 4 years ago

on the first run i created first project with the absolute path. this looks good. first project with absolute path was stored. i can create files and i can create new projects

image

ozett commented 4 years ago

i originally wanted to edit my files in the webroot, so i have to create a project with this path. that is still not possible from the web-gui.

image

ozett commented 4 years ago

editing the project.php by hand let me create this project with a path to the webroot.

image

xevidos commented 4 years ago

Has editing it by hand allowed you to create, delete, and update files and folders?

ozett commented 4 years ago

editing by hand allowed my to have my webroot as a project. within this i can create files, folder and edit.

i could create also new projects (with relative path within the workspace) and could also create files, folders an edit this


the key was to create the first project with absolute path. the bug is: it dont work if you create a "normal" project (means without abs-path)

xevidos commented 4 years ago

As this seems to be solved and storage on the filesystem has not been re added yet I am closing this issue.