Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running api / post / read.php #8

Open
budydo opened this issue Dec 31, 2019 · 1 comment
Open

Error running api / post / read.php #8

budydo opened this issue Dec 31, 2019 · 1 comment

Comments

@budydo
Copy link

budydo commented Dec 31, 2019

I have adjusted to the name of the folder and file as you created, but I still have problems like below. I have analyzed it several times, but it still fails. Please help me.

PHP Warning:  include(../../config/Database.php): failed to open stream: No such file or directory in C:\xampp\htdocs\restfulphp1\api\post\read.php on line 5
PHP Stack trace:
PHP   1. {main}() C:\xampp\htdocs\restfulphp1\api\post\read.php:0

Warning: include(../../config/Database.php): failed to open stream: No such file or directory in C:\xampp\htdocs\restfulphp1\api\post\read.php on line 5

Call Stack:
    0.0003     406744   1. {main}() C:\xampp\htdocs\restfulphp1\api\post\read.php:0

PHP Warning:  include(): Failed opening '../../config/Database.php' for inclusion (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\restfulphp1\api\post\read.php on line 5
PHP Stack trace:
PHP   1. {main}() C:\xampp\htdocs\restfulphp1\api\post\read.php:0

Warning: include(): Failed opening '../../config/Database.php' for inclusion (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\restfulphp1\api\post\read.php on line 5

Call Stack:
    0.0003     406744   1. {main}() C:\xampp\htdocs\restfulphp1\api\post\read.php:0

PHP Warning:  include(../../models/Post.php): failed to open stream: No such file or directory in C:\xampp\htdocs\restfulphp1\api\post\read.php on line 6
PHP Stack trace:
PHP   1. {main}() C:\xampp\htdocs\restfulphp1\api\post\read.php:0

Warning: include(../../models/Post.php): failed to open stream: No such file or directory in C:\xampp\htdocs\restfulphp1\api\post\read.php on line 6

Call Stack:
    0.0003     406744   1. {main}() C:\xampp\htdocs\restfulphp1\api\post\read.php:0

PHP Warning:  include(): Failed opening '../../models/Post.php' for inclusion (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\restfulphp1\api\post\read.php on line 6
PHP Stack trace:
PHP   1. {main}() C:\xampp\htdocs\restfulphp1\api\post\read.php:0

Warning: include(): Failed opening '../../models/Post.php' for inclusion (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\restfulphp1\api\post\read.php on line 6

Call Stack:
    0.0003     406744   1. {main}() C:\xampp\htdocs\restfulphp1\api\post\read.php:0

PHP Fatal error:  Uncaught Error: Class 'Databa
Fatal error: Uncaught Error: Class 'Database' not found in C:\xampp\htdocs\restfulphp1\api\post\read.php on line 14

Error: Class 'Database' not found in C:\xampp\htdocs\restfulphp1\api\post\read.php on line 14

Call Stack:
    0.0003     406744   1. {main}() C:\xampp\htdocs\restfulphp1\api\post\read.php:0

se' not found in C:\xampp\htdocs\restfulphp1\api\post\read.php:14
Stack trace:
#0 {main}
  thrown in C:\xampp\htdocs\restfulphp1\api\post\read.php on line 14

I use version:
Apache/2.4.39 (Win64) OpenSSL/1.1.1b PHP/7.3.5
Database client version: libmysql - mysqlnd 5.0.12-dev - 20150407 - $Id: 7cc7cc96e675f6d72e5cf0f267f48e167c2abb23 $
PHP extension: mysqliDocumentation curlDocumentation mbstringDocumentation
PHP version: 7.3.5

@MaxwellEnemuo
Copy link
Contributor

Run echo realpath('database.php'); in your code to see the correct file path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants