Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Apache App

Posted on 2012-03-21
9
Medium Priority
?
326 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_
  • 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
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.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo‚Ķ
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

886 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