Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 327275

Summary: Problems with PHP includes in web pages
Product: Community Reporter: DJ Houghton <dj.houghton>
Component: WebsiteAssignee: phoenix.ui <phoenix.ui-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: jeffmcaffer, kim.moir
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description DJ Houghton CLA 2010-10-07 16:04:51 EDT
We are having problems with our re-design of the Equinox web pages.

We are following the header in the sample code (http://www.eclipse.org/phoenix/docs/sample_3col.php.txt) which does requireOnce() on some php files but we are getting the following error message when running php on the file. (and we are getting an empty file when trying to view in the browser via http)

PHP Warning:  require_once(/eclipse.org-common/system/app.class.php): failed to open stream: No such file or directory in /home/data/httpd/download.eclipse.org/equinox/drops/N20101006-2000/index.php on line 6
PHP Fatal error:  require_once(): Failed opening required '/eclipse.org-common/system/app.class.php' (include_path='.:/usr/share/php5:/usr/share/php5/PEAR') in /home/data/httpd/download.eclipse.org/equinox/drops/N20101006-2000/index.php on line 6

Kim mentioned this might be related to the way we have doc root set up... it is /home/download.eclipse.org but really on the filesystem it is /home/data/httpd/download.eclipse.org?

Is there something that we are doing wrong? Or maybe the sample files are out of date?
Comment 1 Denis Roy CLA 2010-10-07 16:25:04 EDT
Where is this running?  Are you using require_once($_SERVER['DOCUMENT_ROOT'] . "(path)");
Comment 2 DJ Houghton CLA 2010-10-07 16:27:32 EDT
The file is:
   /home/data/httpd/download.eclipse.org/equinox/drops/N20101006-2000/index.php 
and we have lines like:
   require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php");
Comment 3 DJ Houghton CLA 2010-10-08 08:47:44 EDT
This is strange because we have the same requires statements in other web pages and they work ok.
Comment 4 DJ Houghton CLA 2010-10-08 09:33:45 EDT
Denis: Kim, Jeff and I are still looking into this. Perhaps it is a misplacement of our _projectCommon.php file or something like that. Since the other pages are working, I'll close this for now so you don't waste any more time looking into it and if we have specific problems we can re-open this.
Comment 5 Denis Roy CLA 2010-10-08 10:57:51 EDT
It would be infinitely better if PHP pages intended for the general public be hosted on www.eclipse.org -- it has high quality bandwidth and more processing power than download.eclipse.org.
Comment 6 Jeff McAffer CLA 2010-10-08 13:07:17 EDT
In the end it was likely just some bogus paths.

As for rendering php on download.eclipse.org, yeah, likely better on www but that would require more php coding than we likely have time for right now.  Currently all the php is local to and customized for an individual build with a lot of the logic in Java at build time. We'd have to shift that to have the build output the basic data and have the processed in php for rendering.