Cockpit-HQ / Cockpit

Cockpit Core - Content Platform
https://getcockpit.com
Other
388 stars 47 forks source link

fix $APP_BASE url #223

Closed luislobo9b closed 1 month ago

luislobo9b commented 1 month ago

Remove the backslash "\" at the beginning of the URL to allow installation in a subdirectory, enable playground and API. (tested on XAMPP)

luislobo9b commented 1 month ago

This solves the problem described here: https://discourse.getcockpit.com/t/local-test-with-xampp-fails-with-404-requested-resource-is-not-available-after-install/2932

aheinze commented 1 month ago

This is a windows specific issue and would cause issues on linux/unix based webservers (which is recommended)

luislobo9b commented 1 month ago

@aheinze I don’t understand PHP. I just made this solution because it worked for me. But if it's a case of changing a single character, isn't it just a matter of checking that in the code somehow? This literally breaks the application on Windows.

aheinze commented 1 month ago

I don't have a windows computer to test, but can you try the following code snippet:

$APP_BASE = trim(str_replace($APP_DOCUMENT_ROOT, '', $APP_DIR), DIRECTORY_SEPARATOR);