?
Solved

Apache App

Posted on 2012-03-21
9
Medium Priority
?
325 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 500 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 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 1500 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 111

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 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 1500 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 111

Accepted Solution

by:
Ray Paseur earned 1500 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses how to implement server side field validation and display customized error messages to the client.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

719 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