Solved

Apache App

Posted on 2012-03-21
9
318 Views
Last Modified: 2012-04-09
Hi, i have moved an app to a new VM.  one section of the site is not working.  I am receiving this error in the apache2 log:

PHP Fatal error:  require_once():  Failed opening required '../../../lib/init.php'
(include_path='/usr/share/php:/usr/share/pear') in /var/www/directory/index.php on line 8

Thanks,

Jackson
0
Comment
Question by:Jack_son_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 3

Assisted Solution

by:Charlie2012
Charlie2012 earned 125 total points
ID: 37749649
Hi Jackson,

When you open file:

/var/www/directory/index.php

what configuration is on line 8?

Are you running a 64 bit or 32 bit system?

Where is your php.ini file located?

When you moved your app to the new VM did you recompile apache and php with the same modules as on the previous server?

What version of PHP are you running on the original server and on the new server?

If you create a phpinfo.php file on both servers in the /var/www/appfolder with the following content:

<?php phpinfo(); ?>

You can then go to URL/phpinfo.php This will give you your PHP information for each server so you can compare modules. (remember to remove this after as it is a security risk giving everyone your PHP information).

For apache you can check loaded modules by locating your apachectl file and running /path/apachectl -M or /path/httpd -M this will show loaded modules.
0
 
LVL 110

Assisted Solution

by:Ray Paseur
Ray Paseur earned 375 total points
ID: 37750220
Line 8 of index.php probably says something like this:

require('../../../lib/init.php');

The fatal error means that the path to the init.php script does not point to the right place.  The script may be missing or it may be in a different directory tree.
0
 

Author Comment

by:Jack_son_
ID: 37752236
You are correct about how the line reads.  Where should the init.php file be located?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 110

Expert Comment

by:Ray Paseur
ID: 37752417
Anywhere you want!  Just be sure the require() function calls for the correct path.
0
 

Author Comment

by:Jack_son_
ID: 37752481
I'm a bit new to php, how do I know where it is looking for it.  I see the prefix of the location
.../.../.../lib/init.php

What directory does the .../ represent?
0
 
LVL 110

Assisted Solution

by:Ray Paseur
Ray Paseur earned 375 total points
ID: 37752662
I believe that it is two dots between the directory separators.  A google search for ../ relative path turns up this.
http://en.wikipedia.org/wiki/Path_%28computing%29

So I guess that the ../../../ is telling the machine to look "up" three parent directories above the existing directory.
0
 

Author Comment

by:Jack_son_
ID: 37753141
Okay, thanks - also one other issue in that error undefined variable:  user in /var/www/website.com/html/public/index.php
0
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 375 total points
ID: 37753204
Undefined variable messages are "Notice" level messages.  These are suppressed in PHP by default, thus allowing you to use undefined variables as if they were NULL, FALSE or zero.  So it may be that the old version of the error reporting was something like this:

error_reporting(E_ALL ^ E_NOTICE);

Personally, I always use error_reporting(E_ALL) so that I can see the Notice messages, because when I encounter an undefined variable, it is usually a typographical error on my part.  But if your script is designed to use undefined variables silently, you may want to change the error reporting to stop the Notice messages.
0
 

Author Closing Comment

by:Jack_son_
ID: 37825813
Thanks, these posts resolved the issue
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article discusses how to create an extensible mechanism for linked drop downs.
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question