Another Apache Config Problem??

23 views
Skip to first unread message

philip.j...@gmail.com

unread,
Mar 19, 2016, 5:58:22 PM3/19/16
to ZnetDK
Hi Pascal, thanks for your software.  I just downloaded it and set it up under a directory "znetdk" on my webserver.  I use 1&1 Linux shared hosting.  I have PHP 5.5.6 installed. 

When I loaded the index.php page I got a very broken page that obviously could not access the images, style sheets, scripts, etc.  When I viewed the source of the page, I saw all of the "href" and "src" references looking like this:

href="/engine/public/images/logoznetdk.png"
href="/resources/jquery-ui-1.10.3/themes/base/minified/jquery-ui.min.css"
href="/engine/public/themes/znetdk/theme.css"

The initial "/" makes these absolute paths rather than relative, so what should have pointed to http://www.domain.com/znetdk/engine...  instead pointed to http://www.domain.com/engine... and so on.

I've temporarily made it work by adding sym links at the root web directory for engines, resources, and applications down to the real directories under znetdk.  Now the page loads correctly, and so does the App Wizard.  I haven't yet tried anything further.  

It seems that some variable is not defined by the web server as the code expected it to be.  Have you seen this before? Did I do something wrong on installation?

Pascal Martinez

unread,
Mar 20, 2016, 6:30:10 AM3/20/16
to ZnetDK
Hello Philip,

ZnetDK reads the SCRIPT_NAME entry of the $_SERVER PHP variable to evaluate the web root directory and then to set the path of the web resources in the page.

For security purpose, this entry is sanitized by calling the following statement: filter_input(INPUT_SERVER, 'SCRIPT_NAME', FILTER_SANITIZE_URL).

I know that the PHP filter_input() function can return a null value on some FastCGI virtualized hosting.
Perhaps is this your case?

To check if your issue is caused by the filter_input() function,  I propose you to modify the General::getMainScript() method in the znetdk/engine/core/general.php script as shown below:

static public function getMainScript($includeGetParameter = FALSE) {
   
// The original code is commented...
   
// $script = filter_input(INPUT_SERVER, 'SCRIPT_NAME', FILTER_SANITIZE_URL);
   
   
// The new code below for test purpose only
   $script = $_SERVER['SCRIPT_NAME'];

   
if ($includeGetParameter && !self::isDefaultApplication()) {
            $script
= self::addGetParameterToURI($script,
                       
\Request::getOtherApplication(TRUE), ZNETDK_APP_NAME);
   
}
   
return $script;
}


This modification is for test purpose only. If your ZnetDK application works after this adjustment, then I will publish ASAP a new patch to fix this problem.

Wating for your feedback,

Pascal MARTINEZ

philip.j...@gmail.com

unread,
Mar 21, 2016, 11:02:52 AM3/21/16
to ZnetDK
Yes, indeed, that fixes it.  All of the urls now start with "/znetdk" as they should and the pages load correctly without the symlinks.



Pascal Martinez

unread,
Mar 21, 2016, 5:13:11 PM3/21/16
to ZnetDK
OK fine,

I will release very soon a new patch of ZnetDK in version 1.22 to fix this issue.

See you,

Pascal MARTINEZ

Pascal Martinez

unread,
Mar 26, 2016, 3:29:32 AM3/26/16
to ZnetDK
Hello Philip,

I've published today the ZnetDK 1.22 software patch that fixes the problem described in this post.
You can download it from this url: http://znetdk.fr/telechargements#v1.22

Could you please install it on your hosting server to validate that it solves your issue?

Thank you,

Pascal MARTINEZ

philip.j...@gmail.com

unread,
Mar 28, 2016, 6:37:42 PM3/28/16
to ZnetDK
Patch 1.22 fixes the issue.

Pascal Martinez

unread,
Mar 29, 2016, 2:56:41 PM3/29/16
to ZnetDK
Thank you Philip for your feedback,

Pascal MARTINEZ
Reply all
Reply to author
Forward
0 new messages