There's a couple of problems. debug50 and gdb would be very helpful in troubleshooting and debugging server.
The backtrace errors are seg faults that are coming from the indexes function.
This temp = strchr(line,((char)63)+1); looks like a problem. It is asking strchr to find '@' (ascii 64) in line. Since it doesn't find '@', temp is NULL and program gives a ...
Some guidelines. Look at this:
char* inx = malloc(sizeof (strlen(path) + strlen(ind_html) + 1));
This entire expression is an int: (strlen(path) + strlen(ind_html) + 1)
Can you tell what is the sizeof an int?
And as a side note:
You don't need the slash / here:
char* ind_php = "/index.php";
char* ind_html = "/index.html";
You can use just "index.php" ...
I can tell you one problem right away. This part won't work with pipe streams like php files:
//get the length of file in bytes
fseek(file, 0, SEEK_END);
byte_length = ftell(file);
fseek(file, 0, SEEK_SET);
To get the load() function working correctly 100% of the time, one usually needs to read from the stream progressively and use realloc() ...
Yes, debugging server is challenging. It takes patience, practice and perseverance. You will find intro material for debug50 here, and some tips on gdb here. It is really worth the investment of time. I have found it easier to debug with curl requests instead of browser requests. The main thing to remember is: if server is not doing anything, it is probably ...