LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-24-2018, 09:15 AM   #1
LEON71
Member
 
Registered: May 2018
Location: Canada
Distribution: Fedora 38 Workstation
Posts: 87

Rep: Reputation: Disabled
PHP Error - Help Please


Suppose I am troubleshooting a client site that is not loading properly and I find find this error on the php error_log:

[Mon May 28 04:56:09 2012] [error] [client 109.182.33.xx] PHP Warning: require(): Failed opening './includes/login.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/public_html/index.php on line 5
[Mon May 28 04:56:09 2012] [error] [client 109.182.33.xx] PHP Fatal error: Call to undefined function login() in /var/www/public_html/index.php on line 12

  1. What's going on?
  2. Why the PHP fatal error?
  3. How can I fix it?
 
Old 06-24-2018, 09:35 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
It seems self explanatory, it fails to open login.php file which is supposed to be in /var/www/public_html/includes directory
 
Old 06-24-2018, 09:37 AM   #3
LEON71
Member
 
Registered: May 2018
Location: Canada
Distribution: Fedora 38 Workstation
Posts: 87

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by keefaz View Post
It seems self explanatory, it fails to open login.php file which is supposed to be in /var/www/public_html/includes directory
Thanks for the reply. How can I fix it ?
 
Old 06-24-2018, 09:53 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,617

Rep: Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963
Quote:
Originally Posted by LEON71 View Post
Thanks for the reply. How can I fix it ?
Really?? Since it's looking for the login.php file in /var/www/public_html/includes, wouldn't it make sense to COPY THAT FILE to that location??
 
Old 06-24-2018, 11:36 AM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
The first thing to check is whether you actually have a public_html directory under /var/www/. I would be surprised if you did. Generally, you will have the apache files including index.html under /var/www/html or htdocs depending upon which distribution you are using which you have not indicated. The public_html directory should be in the /home/user directory and you have to enable/configure this as it usually isn't set up by default. You need to load the userdir_module for your distribution.

Check your DocumentRoot in the apache httpd.conf file and if you don't resolve this, indicate which Linux you are using in your next post.

Last edited by yancek; 06-24-2018 at 11:39 AM.
 
Old 06-24-2018, 03:47 PM   #6
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Of course there is a public_html directory under /var/www, PHP message reports the script where the error came from
Quote:
in /var/www/public_html/index.php on line 5
 
Old 06-26-2018, 12:19 PM   #7
dogpatch
Member
 
Registered: Nov 2005
Location: Central America
Distribution: Mepis, Android
Posts: 490
Blog Entries: 4

Rep: Reputation: 238Reputation: 238Reputation: 238
... or the file is there, but its permissions do not allow reading it
 
  


Reply

Tags
php, php enable webmin



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP error after upgrading to latest version of PHP Skillz Programming 3 08-17-2012 08:02 PM
Site error: the file /var/www/hotel/index.php requires the ionCube PHP Loader ioncube muba Linux - Software 1 06-03-2010 10:38 AM
Getting Error: Missing Dependency: php-common, when trying to install php-soap amish123 Linux - Software 3 02-18-2010 07:26 PM
PHP5 Upgrade Error: Missing Dependency: php = 4.3.x is needed by package php-pear vsystems Linux - Server 1 05-02-2007 07:17 AM
PHP parse error in config.inc.php.in Confusedious Linux - Software 2 11-03-2005 05:08 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration