0

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.

Community
  • 1
  • 1
Krug
  • 1,003
  • 13
  • 33
  • 1
    Looks like a problem with slashes to me. Notice the file that fails to be found has slashes in both the forwards and backwards direction? I've got files at `C:\xampp2\htdocs\snippets` if I try to open `c:\xampp2\htdocs\snippets/matrix.html` in notepad++ it fails with the message "snippets/matrix.html The filename is not valid". If on the other hand, I try to open `c:\xampp2\htdocs\snippets\matrix.html` it's fine. Conversely, `c:/xampp2/htdocs/snippets/matrix.html` fails with a "File not found" type message. – enhzflep Sep 17 '16 at 04:45

1 Answers1

0

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.

Krug
  • 1,003
  • 13
  • 33