PHP/SQL - failed to open stream: No such file or directory

Krug

Set up a (Wordpress) local website using WAMP. For security reasons, in phpmyadmin, created a new user and deleted user root. New user was supposed to have global privileges, but had none.

Used the following post to recreate user root deleted-mysql-root-user-using-phpmyadmin-how-to-restore. It worked, partially (i.e. recreated root user, that has Global Privileges, yet still can't create new databases, as it says "Create database: Documentation; No Privileges"). But now site is broken. I get the following error when going to localhost/mywebsite :

    Warning: require(C:\wamp64\www\wordpress1\wordpress/wp-includes/session.php): failed to open stream: No such file or directory in C:\wamp64\www\wordpress1\wordpress\wp-settings.php on line 150
    Call Stack
    #   Time    Memory  Function    Location
    1   0.0000  236160  {main}( )   ...\index.php:0
    2   0.0025  239304  require( 'C:\wamp64\www\wordpress1\wordpress\wp-blog-header.php' )  ...\index.php:17
    3   0.0025  259856  require_once( 'C:\wamp64\www\wordpress1\wordpress\wp-load.php' )    ...\wp-blog-header.php:13
    4   0.0050  271784  require_once( 'C:\wamp64\www\wordpress1\wordpress\wp-config.php' )  ...\wp-load.php:39
    5   0.0075  403592  require_once( 'C:\wamp64\www\wordpress1\wordpress\wp-settings.php' )    ...\wp-config.php:92

    Fatal error: require(): Failed opening required 'C:\wamp64\www\wordpress1\wordpress/wp-includes/session.php' (include_path='.;C:\php\pear') in C:\wamp64\www\wordpress1\wordpress\wp-settings.php on line 150
    Call Stack
    #   Time    Memory  Function    Location
    1   0.0000  236160  {main}( )   ...\index.php:0
    2   0.0025  239304  require( 'C:\wamp64\www\wordpress1\wordpress\wp-blog-header.php' )  ...\index.php:17
    3   0.0025  259856  require_once( 'C:\wamp64\www\wordpress1\wordpress\wp-load.php' )    ...\wp-blog-header.php:13
    4   0.0050  271784  require_once( 'C:\wamp64\www\wordpress1\wordpress\wp-config.php' )  ...\wp-load.php:39
    5   0.0075  403592  require_once( 'C:\wamp64\www\wordpress1\wordpress\wp-settings.php' )    ...\wp-config.php:92

All files exist. I presume problem is server does not have access to the files or database. The following question/answer may have the answer to my problem: php-failed-to-open-stream-no-such-file-or-directory/36577021. But I do not understand the instructions provided on point 4 of the accepted answer - see below:

/*To check under what user the server is running you can use posix_getpwuid :*/
$user = posix_getpwuid(posix_geteuid());
var_dump($user);

How do I do that?

-- To find out the permissions on the file, type the following command in the terminal:
ls -l <C:/wamp64/www/wordpress1/wordpress>

Did not work for me. Typing that in the terminal results in an arrow after pressing enter.

I have spent 12 full hours on this and I am at wits end. Would greatly appreciate any help. Thank you.

Krug

Solved my issue by doing the following:

  1. save wp-site folder / delete wamp / reintall wamp
  2. place wp-site folder inside wamp
  3. create SQL database in phpmyadmin / import database backup

    => exact same error => problem is inside wp-site folder

  4. replaced core wordpress files/folders with clean install, keeping prior wp-content folder and wp-config.php

PRESTO. Sometimes better to not understand the problem, and start from scratch.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Failed to open stream: No such file or directory

From Dev

failed to open stream: No such file or directory

From Java

PHP - Failed to open stream : No such file or directory

From Java

failed to open stream: No such file or directory (Laravel)

From Dev

SplFileObject error failed to open stream: No such file or directory

From Dev

PHPUnit error "Failed to open stream: No such file or directory"

From Dev

PHP - failed to open stream: No such file or directory in

From Dev

failed to open stream: No such file or directory issue

From Dev

file_get_contents(): failed to open stream: No such file or directory

From Dev

file_get_contents() failed to open stream: No such file or directory

From Dev

move_uploaded_file(...): failed to open stream: No such file or directory

From Dev

File exists but PHP throwing "failed to open stream: no such file or directory"

From Dev

File upload on s3 : failed to open stream: No such file or directory

From Dev

File exists but PHP throwing "failed to open stream: no such file or directory"

From Dev

file_get_contents(): failed to open stream: No such file or directory

From Dev

file exists but fopen "failed to open stream no such file or directory"

From Dev

Laravel classloader.php error failed to open stream: No such file or directory

From Dev

Zend include_once(myphpfile): failed to open stream: No such file or directory

From Dev

autoload.php issue: failed to open stream: no such file or directory

From Dev

Warning: include(PHPExcel.php): failed to open stream: No such file or directory

From Dev

Failed to open stream: No such file of directory in... PHP fopen

From Dev

php artisan migrate:reset failed to open stream: No such file or directory

From Dev

failed to open stream: No such file or directory (but files are in the correct location)

From Dev

app/bootstrap.php.cache : failed to open stream: No such file or directory

From Dev

Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

From Dev

yii PDO.php error: failed to open stream: No such file or directory

From Dev

Warning: include(dbconn.php): failed to open stream: No such file or directory

From Dev

Failed to open stream: No such file or directory in...? PHP Specific

From Dev

Zend include_once(myphpfile): failed to open stream: No such file or directory

Related Related

  1. 1

    Failed to open stream: No such file or directory

  2. 2

    failed to open stream: No such file or directory

  3. 3

    PHP - Failed to open stream : No such file or directory

  4. 4

    failed to open stream: No such file or directory (Laravel)

  5. 5

    SplFileObject error failed to open stream: No such file or directory

  6. 6

    PHPUnit error "Failed to open stream: No such file or directory"

  7. 7

    PHP - failed to open stream: No such file or directory in

  8. 8

    failed to open stream: No such file or directory issue

  9. 9

    file_get_contents(): failed to open stream: No such file or directory

  10. 10

    file_get_contents() failed to open stream: No such file or directory

  11. 11

    move_uploaded_file(...): failed to open stream: No such file or directory

  12. 12

    File exists but PHP throwing "failed to open stream: no such file or directory"

  13. 13

    File upload on s3 : failed to open stream: No such file or directory

  14. 14

    File exists but PHP throwing "failed to open stream: no such file or directory"

  15. 15

    file_get_contents(): failed to open stream: No such file or directory

  16. 16

    file exists but fopen "failed to open stream no such file or directory"

  17. 17

    Laravel classloader.php error failed to open stream: No such file or directory

  18. 18

    Zend include_once(myphpfile): failed to open stream: No such file or directory

  19. 19

    autoload.php issue: failed to open stream: no such file or directory

  20. 20

    Warning: include(PHPExcel.php): failed to open stream: No such file or directory

  21. 21

    Failed to open stream: No such file of directory in... PHP fopen

  22. 22

    php artisan migrate:reset failed to open stream: No such file or directory

  23. 23

    failed to open stream: No such file or directory (but files are in the correct location)

  24. 24

    app/bootstrap.php.cache : failed to open stream: No such file or directory

  25. 25

    Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

  26. 26

    yii PDO.php error: failed to open stream: No such file or directory

  27. 27

    Warning: include(dbconn.php): failed to open stream: No such file or directory

  28. 28

    Failed to open stream: No such file or directory in...? PHP Specific

  29. 29

    Zend include_once(myphpfile): failed to open stream: No such file or directory

HotTag

Archive