-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
help me enable PHP #17
Comments
Unlike other popular web servers, Merecat does not allow serving content outside its server directory. It's a security thing. Also, for this to work you need to run the still unreleased (unstable) master branch. It's a work in progress, sorry. |
yes, my proyect or test proyect it's a subdirectory, |
Aha, OK I'll look into it. See if I can find some time later today, otherwise it'll be tomorrow. Don't worry about your English, we'll manage :) In the meantime, have you seen my write-up of how to use regular CGIs? 👉 https://troglobit.com/2019/08/Basic-CGI-in-C-with-Merecat-httpd/ |
OK, I've reproduced your problem. Looking into it |
Found it! :-) Turned out to be a regression introduced fairly recently. Sorry about the problems it caused you! :-( |
yes php now works but only if merecat is executed in the current directory, if the "directory" variable is configured, php stops working, if it is not configured php works again |
When both directory and data-directory are given, but not chroot, we must compose the resulting server path *and* append a final slash to it so we can reference the files/scripts in the server root. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Sorry about that. The |
@RicardoG08 Does everything work now, or do you have any lingering problems and want me to reopen this issue? |
php works fine if |
Nope, chroot is an actual dedicated confined area, like the man page chroot(1) says. In a chroot you cannot access anything outside of it, like /usr/bin/php-cgi or even the C library in /usr/lib. Thank you for responding, I'll make sure to clarify these things in the documentation! |
very well, I really like Merecat, I am using it for my PHP practices, it is easy to configure compared to other http / https web servers, I will keep testing the software, and I will report bugs or any problems I find, it is the only way I can help the project |
Thank you so much! All contributions are welcome :-) I want to add more simple (!) unit tests. Those are just scripts that usually employ curl. Take a look at how I added a basic CGI test here -> 6a0735f. Wanted to add a php test as well, but I'm not that well versed in php, and I don't have any example PHP CGI in the repo. But I guess a simple phpinfo test would be really useful. |
hello again, how long has it been ..., i have continued testing merecat since then, haven't you considered adding support for different extensions for indexes? for example index.php natively? |
Great to hear back from you! Did you mean like this, which is already in /* CONFIGURE: A list of index filenames to check. The files are searched
** for in this order.
*/
#define INDEX_NAMES "index.shtml", "index.shtm", "index.stm", \
"index.cgi", "index.php", \
"index.html", "index.htm", \
"index.xhtml", "index.xht", \
"Default.htm" |
yes, I have it exactly the same, but it does not detect the index.php unless I tell it explicitly from the browser url |
Well that's a bug (separate from this one, so we should open a new one), unless you have one of the other ones also in the root directory? |
my root directory is "/ var / www" with a "data-directory = / htdocs", which contains the folders "/ a", "/ b" and "/ c", the folders "a" and "b" they contain an index.html and it works fine, but folder "c" has an index.php, it doesn't run automatically unless I specify it in the browser url |
OK, that's certainly not how it's supposed to work. It should check for all the |
Thank you <3 |
Merecat not support Query strings in PHP?? |
I don't even know what that is, but the full environment and arguments to the CGI should be passed to php, if that's what you mean? |
yes, exactly, but for example, Mercat returns error 403 for a valid url like the following: http://192.168.1.1/htdocs/foro/fudforum/install.php?1463445063 |
Aha, well that's yet another bug (and more for me to do, unless someone pitches in). Please report a separate issue. |
sorry if I'm not helpful in terms of programming |
I understand, that's OK. Free/Open Source Software needs all sorts of talent to help out :) |
This is my configuration, I installed php and php-cgi, but I couldn't enable php, it doesn't run the example script phpinfo.php, it just shows plain text of php code:
The text was updated successfully, but these errors were encountered: