Accidently deleted wp-admin/index.php file - php

I accidently deleted wp-admin/index.php file, but when I uploaded the file again (index.php) it's producing an error.
Warning:
require_once(/home/kiddyfan/public_html/huatsms.com/wp-admin/admin.php)
[function.require-once]: failed to open stream: No such file or
directory in /home/kiddyfan/public_html/huatsms.com/wp-admin/index.php
on line 10
Fatal error: require_once() [function.require]: Failed opening
required '/home/kiddyfan/public_html/huatsms.com/wp-admin/admin.php'
(include_path='.:/usr/lib/php:/usr/local/lib/php') in
/home/kiddyfan/public_html/huatsms.com/wp-admin/index.php on line 10
What should I do? Could it be a permission setting?

Since it's a core file, you can get it again from the WordPress repository.
Download the version of WordPress you're using from the Release Archive.
Then overwrite your current wp-admin folder with the contents of the zip file you've downloaded. Or just your admin.php file.

Related

Warning: require_once(/home/orgdevelopers.tk/public_html/ok/app/Config/constant.php): failed to open stream: No such file or directory in

You can see the error on http://orgdevelopers.tk/api/app/Config/core.php
my php version is 7.0.33.
I am getting this error when I execute my PHP file. Please help.
{Warning: require_once(/home/orgdevelopers.tk/public_html/ok/app/Config/constant.php): failed to open stream: No such file or directory in /home/orgdevelopers.tk/public_html/ok/core.php on line 3
Fatal error: require_once(): Failed opening required '/home/orgdevelopers.tk/public_html/ok/app/Config/constant.php' (include_path='.:/usr/local/lsws/lsphp70/share/pear:/usr/local/lsws/lsphp70/share/php:/usr/share/pear:/usr/share/php') in /home/orgdevelopers.tk/public_html/ok/core.php on line 3}
core.php line 3 is== require_once('app/Config/constant.php');
If both files reside in same directory, The path of constant.php in require_once function in core.php should be constant.php or /api/app/Config/constant.php or __DIR__.'/constant.php' instead of app/Config/constant.php

My joomla website does not display at the front end

This is what is displayed in the browser when I try to open it:
Warning: require_once (/home/recoveryuganda/public_html/includes/defines.php):
failed to open stream: No such file or directory in /home/recoveryuganda/public_html/index.php on line 37
Fatal error: require_once():
Failed opening required '/home/recoveryuganda/public_html/includes/defines.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/recoveryuganda/public_html/index.php on line 37
NO file exist in the path that specified, check, maybe you change the name, or moved to some other place the file.
just go to this directory:
/home/recoveryuganda/public_html/includes/
and find this file: defines.php
the problem is this file is missing/
if you have a backup of that file put it in that directory.

How to add Smarty in wamp php.ini file

I need to add libs for smarty in php.ini, but do I find which file I have to add, where can I find the sub directory being included in php directory.....
I have the following error when trying to access the pages on my site in wamp:
Warning: require(..../public_html/libs/Smarty.class.php): failed to open stream: No such file or directory in
Fatal error: require(): Failed opening required '...../public_html/libs/Smarty.class.php' (include_path='PEAR/') in
Apology if the question is too stupid..:)

application path in codeigniter in php

My system's path is C:\xampp\htdocs\codeigniter and my application folder is inside the system folder. I am facing the following error..
Warning: require_once(C:/xampp/htdocs/codeigniter/core/CodeIgniter.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\codeigniter\index.php on line 202
Fatal error: require_once() [function.require]: Failed opening required 'C:/xampp/htdocs/codeigniter/core/CodeIgniter.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\codeigniter\index.php on line 202
Your system path should be:
C:\xampp\htdocs\codeigniter\system
And your app path should be:
C:\xampp\htdocs\codeigniter\application
Did you change these?
Your index.php file cannot find the path you specified which means the path is probably incorrect unless you are having permission issues.

Correct path to file in LiteSpeed web server on Linux

I have the following PHP script placed in the root directory of my web hosting server, and it works fine.
<?php
include(dirname(__FILE__).'/config/config.inc.php');
require_once(dirname(__FILE__).'/init.php');
When I moved the script to a new folder under my web root, i.e. public_html/myfolder, the script gives the following error:
Warning: include(/home/name/public_html/folder/config/config.inc.php) [function.include]: failed to open stream: No such file or directory in /home/name/public_html/folder/test.php on line 2
Warning: include() [function.include]: Failed opening '/home/name/public_html/folder/config/config.inc.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/name/public_html/folder/test.php on line 2
Warning: require_once(/home/name/public_html/folder/init.php) [function.require-once]: failed to open stream: No such file or directory in /home/name/public_html/folder/test.php on line 3
Fatal error: require_once() [function.require]: Failed opening required '/home/name/public_html/folder/init.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/name/public_html/folder/test.php on line 3
Should I change the path as follows:
<?php
include(dirname(__FILE__).'/../config/config.inc.php');
require_once(dirname(__FILE__).'/../init.php');
Am I correct?
Uhm, you say you only moved your script (the one that contains the include lines) to the "public_html/folder". That way, dirname(__FILE__) contains the full path, including the "folder" directory. So, now, you need to go up one step in the directory tree, to be able to reach the "config" directory; an explanation follows:
Before you had:
/home/name/public_html/config/config.inc.php
/home/name/public_html/init.php
So your file
/home/name/public_html/test.php
Managed to access the files using the path from dirname(__FILE). But now, the test.php has been movedto the directory "folder":
/home/name/public_html/folder/test.php
Thus, dirname(__FILE__) should return the path comprehensive of the "folder" directory. But the files you need to include are in teh "old" directory, so youneed to add that ../ to the path of the include, to be abletoreach those files :)

Categories