Jean-Paul
Jean-Paul

Reputation: 126

PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0

I start with PHP, wampserver and Composer on windows 10 and it will be a week that I can not fix this problem: When I type:

php -S localhost:8000 -d display_errors = 1 public/

on the browser by running: "localhost:8000/test", I have this error:

Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0

Fatal error: Unknown: Failed opening required 'public/' (include_path = '.;C:\wamp64\bin\php7.1.9\pear') in Unknown on line 0

I installed the famous "pear", I modify the access mode to my project with:

chmod -R 777 or 755 myFramework

I even touched php.ini in apache folder and in php folder to add this line :

include_path
= '.;C:\wamp64\bin\php7.1.9\pear'

But nothing is working ! Can you help me ?

Upvotes: 4

Views: 8979

Answers (2)

C_J
C_J

Reputation: 19

If you are on an IBM i (v7r3, v7r4, v7r5) do the following: ===> CHGSECAUD F4 to add *AUTFAIL ===> CPYAUDJRNE ENTTYP(AF) OUTFILE(QGPL/QAUDITAF) JRNRCV(*CURCHAIN) FROMTIME(MMDDYY HHMMSS) TOTIME(MMDDYY HHMMSS) <<< Adjust the time and date range

Run this SQL command: select * from QGPL.QAUDITAF

column AFPNM will have the IFS path having the authority issue.

Upvotes: -1

JazZ
JazZ

Reputation: 4579

The command line is wrong.

From man php or from the PHP CLI online Manual :

  • First

    --define foo[=bar]

    -d foo[=bar] Define INI entry foo with value bar

(note that there is no space before and after the = sign)

  • Second

    --docroot docroot

    -t docroot Specify the document root to be used by the built-in web server

(you need to specify the document root with the -t parameter)

So, the final command will look like this :

php -S localhost:8000 -d display_errors=1 -t public/

And it should work as expected.

Upvotes: 5

Related Questions