PHP error for an include file on server - php

I've recently moved my site to a new server and I'm getting the following error on the new server.
[Thu Jan 17 01:30:09 2013] [error] [client] PHP Fatal error: require_once(): Failed opening required 'RB/stdlib.php' (include_path='.:/usr/share/php:/usr/share/pear') in /usr/share/application.php on line 90
I may not have copied a the RB directory but I'm unsure where it is. I've copied the pear folder but still receiving the same error.
Any idea how to resolve this issue and how to get the RB folder with the libs on the new server?
Thanks

Related

fail to open file in laravel.The localhost page isn’t working localhost is currently unable to handle this request. HTTP ERROR 500

When I try to run my project, I am getting this error in terminal.
[Fri Mar 30 14:36:23 2018] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
[Fri Mar 30 14:36:23 2018] PHP Fatal error: Unknown: Failed opening required '/var/www/html/imporeexcel/public/server.php' (include_path='.:/usr/share/php') in Unknown on line 0
I confirmed the issue, it seems a bug in laravel 5.6.12 installer. It deletes the server.php upon the first artisan serve.
A temporary solution will be to create another project then copy that newly created server.php this will solve it.
EDIT:
If your anti-virus is avast, you need to add exception there, I have a response in GitHub that avast considers it as a threat.

PHP unable to open include file

I have a problem with a PHP script. The following error is being logged whenever the site is accessed:
[Fri Sep 26 11:57:56 2014] [error] [client 31.22.44.2]
PHP Fatal error: require_once(): Failed opening required
'./sites/default/modules/views/handlers/views_handler_field_markup.inc'
(include_path='.:/usr/share/php:/usr/share/pear') in
/var/www/www.xoomtalk.com/htdocs/sites/default/modules/views/includes/handlers.inc
on line 76
I have confirmed that the file referenced is present, and that www-data can access it. Permissions look fine and have not been changed as far as I am aware
What am I missing?
[Fri Sep 26 11:57:56 2014] [error] [client 31.22.44.2] PHP Fatal
error: require_once(): Failed opening required
'./sites/default/modules/views/handlers/views_handler_field_markup.inc'
(include_path='.:/usr/share/php:/usr/share/pear') in
/var/www/www.xoomtalk.com/htdocs/sites/default/modules/views/includes/handlers.inc
on line 76
Add path /var/www/www.xoomtalk.com/htdocs into your include_path
More explains:
your include_path=.:/usr/share/php:/usr/share/pear , means php script will find include file in: current_path, /usr/share/php or /usr/share/pear
when you want to require this file
./sites/default/modules/views/handlers/views_handler_field_markup.inc
all allowed path are:
(current path)
/var/www/www.xoomtalk.com/htdocs/sites/default/modules/views/includes/./sites/default/modules/views/handlers/views_handler_field_markup.inc
(/usr/share/php) /usr/share/php/./sites/default/modules/views/handlers/views_handler_field_markup.inc
(/usr/share/pear)
/usr/share/pear/sites/default/modules/views/handlers/views_handler_field_markup.inc
In these path ,php can't find the file.
in the following file:
/var/www/www.xoomtalk.com/htdocs/sites/default/modules/views/includes/handlers.inc
on line 76
Change This:
'./sites/default/modules/views/handlers/views_handler_field_markup.inc'
to THIS: '/var/www/www.xoomtalk.com/htdocs/sites/default/modules/views/handlers/views_handler_field_markup.inc'
This should do the trick.
The problem is, you're using scripts from various directories, but the "root" of the request is the cwd (current working directory) which you can check with: getcwd()
(and you're requesting the include relative to the cwd.
I managed to solve this problem, ended up being nothing to do with permissions or paths, although there was no indication of this in the Apache logs.
The problem was that the server was also running AppArmor which for some reason was blocking the Apache process from accessing the files.
AppArmor was set to complain rather than enforce mode for testing (command is aa-complain apache2) this made everything start working.
Thanks to all contributors for their suggestions.

Why I'm getting the PHP Fatal error in following scenario?

I'm using LAMP on my local machine. I'm getting the following error in apache error log and a blank web page in browser when I hit the URL:http://localhost/smart-rebate-web/web/admin/forgot_password.php
Following is the error I got in apache error log:
[Tue Apr 15 17:10:18 2014] [error] [client 127.0.0.1] PHP Fatal error: require_once(): Failed opening required 'includes/public-application-header.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/smart-rebate-web/web/admin/forgot_password.php on line 2, referer: http://localhost/smart-rebate-web/web/admin/login.php?lout=1
For your reference I'm attaching the image of my project structure titled 'smart-rebate-web' in Netbeans editor.
and following is the sceenshot of abrwser after I hit the URL :
http://localhost/smart-rebate-web/web/admin/forgot_password.php
So can anyone please help me in resolving this issue please? Thanks in advance. If you want any further information or any code I can provide you the same. Following asre the permissons of these files if I print in terminal:
-rw-rw-r-- 1 eywa eywa 1646 Apr 14 13:05 application-header.php
-rw------- 1 eywa eywa 1006 Apr 10 18:06 public-application-header.php
You have permission issue. According to your current file permission, only file owner can read and write that file, others cannot read. When you go on browser, default www-data user tries to read that file. And it is not permitted. Make your file 644 or change file owner to www-data. ``www-data` is the apache user used while you open php files from browser. And more flexible way, use following;
require_once(dirname(__FILE__) . "/includes/public-application-header.php");
Try using
require_once('web/admin/includes/<filename>');

how can I know what is the necessary permission for my new codeigniter project?

I just installed apache2 and php5 on my ubuntu computer, Ive done it before on debian but now I have a weird error.
when I try to reach a page with my framework in CodeIgniter I get this error
[error] [client 127.0.0.1] PHP Warning: require_once(/var/www/project/system/core/CodeIgniter.php): failed to open stream: Permission denied in /var/www/project/index.php on line 202, referer: localhost/
[error] [client 127.0.0.1] PHP Fatal error: require_once(): Failed opening required '/var/www/project/system/core/CodeIgniter.php' (include_path='.:/usr/share/php5-common') in /var/www/project/index.php on line 202, referer: localhost/
before that I have an error of not found on my include_path, so , I changed it on my php.ini and i changed it to :/usr/share/php5-common
Still... I have NO idea what is the error...
I changed permissions on my /var/www folder and its like user:user
on the line of index.php I have this:
require_once BASEPATH.'core/CodeIgniter.php';
Most probably your $config['base_url'] is wrong.
Make sure its properly identifies the localhost or IP you are using to access localhost.
I mean if you are accessing local server or remote server using http://[ipaddress] then you have to define baseurl like that only.
in your case may be **$config['base_url'] = http://127.0.0.1/codeigniter_project_name**
Similarly that applies to database config also.

Ubuntu 11.10 PHP don't proceed

i've just setup a LAMP development environment on my laptop, all works fine except for php. Apache don't process PHP code embeded inside pages, and display no error. All php package seems to be correctly installed.
Testing a simple: <?php phpinfo(); ?>, give a blank page
error log give:
[Fri Mar 02 20:30:13 2012] [error] [client 127.0.0.1] PHP Fatal error: Unknown: Failed opening required '/home/lib/utils/setDocumentRoot.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0
I finally solve my problem, it was due to a fix i've set in my virtualHost config (who was calling a missing file: setDocumentRoot.php), i've disabled that script and all works great.

Categories