failed to open stream (constants.php)

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
mike_s
Posts: 10
Joined: Thu Dec 02, 2004 8:15 pm

failed to open stream (constants.php)

Post by mike_s »

Hello,

I made all the required chmod changes to get the mkdir function to work. Once i got through those problems I received this error on the top of the installer.php file.


Warning: main(/xxxxxxxxx/faq/inc/constants.php): failed to open stream: Permission denied in /xxxxxxxxxxxxxxxx/faq/install/installer.php on line 19

Fatal error: main(): Failed opening required '/xxxxxxxxxx/faq/inc/constants.php' (include_path='.:/xxxxxxxxxxxx/') in /xxxxxxxxxxxxx/faq/install/installer.php on line 19


Do i have to add the /inc/ directory to my apache include path?

Any help is greatly appreciated.

Thanks,
Mike
Thorsten
Posts: 15741
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

it seems your Apache hasn't the right to read the file constants.php.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
mike_s
Posts: 10
Joined: Thu Dec 02, 2004 8:15 pm

Post by mike_s »

so would i need to change the permissions of that file or directory? change the ownership? I am not sure how to correct that problem.
Thorsten
Posts: 15741
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

the script needs the right to read the file.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
mike_s
Posts: 10
Joined: Thu Dec 02, 2004 8:15 pm

Post by mike_s »

OK

installer.php and constant.php both have the same owner, and are wide open with permissions.

-rwsrwsrwt 1 apache 21632 Dec 2 14:05 installer.php
-rwsrwsrwt 1 apache 7453 Dec 2 13:03 constants.php

still getting the same error.

Any other ideas?

I would really like to see how this software works.

Thanks,
Mike
Thorsten
Posts: 15741
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

a chmod 755 should be okay.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
mike_s
Posts: 10
Joined: Thu Dec 02, 2004 8:15 pm

Post by mike_s »

OK

I chmoded constants.php

-rwxr-xr-x 1 apache 7453 Dec 2 13:03 constants.php

still getting the exact same error

Warning: main(/usr/local/xxxxxxxx/knowledge/faq/inc/constants.php): failed to open stream: Permission denied in /usr/local/xxxxxxxx/knowledge/faq/install/installer.php on line 19

Fatal error: main(): Failed opening required '/usr/local/xxxxxxxx/knowledge/faq/inc/constants.php' (include_path='.:/usr/local/xxxxxxs/xx/func/') in /usr/local/apache/xxxxxxx/knowledge/faq/install/installer.php on line 19


Why are there so many permissions errors with this install? I am no UNIX master but i never have this many problems.

Thanks,
Mike
Thorsten
Posts: 15741
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

okay, I got the problem.

In line 19 of installer.php you see

Code: Select all

require_once(PMF_ROOT_DIR."/inc/constants.php");
Change it to:

Code: Select all

require_once("../inc/constants.php");
and it should work.

Or add your htdocs directory to the PHP include path.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
mike_s
Posts: 10
Joined: Thu Dec 02, 2004 8:15 pm

Post by mike_s »

Hi Thorsten,

I hate to keep bothering you. If I can't get this to work soon I am afraid I will have to abandon it.

First I changed the require_once line as per your last post. Same error. I had already messed around with that to make sure that root directory constant was spittiing out the correct path (which is was/is).

Then I just added the path to the inc folder into my include_path in the ini file and restarted apache. Sure enough now i get the same error olny it shows my updated include path:


Warning: main(/usr/local/apache/xxxxx/knowledge/faq/inc/constants.php): failed to open stream: Permission denied in /usr/local/apache/xxxxxxx/knowledge/faq/install/installer.php on line 19

Fatal error: main(): Failed opening required '/usr/local/apache/xxxxxx/knowledge/faq/inc/constants.php' (include_path='.:/usr/local/lib/php/:/usr/local/apache/xxxxxxx/:/usr/local/apache/xxxxxxx/knowledge/faq/inc/') in /usr/local/apache/xxxxxxx/knowledge/faq/install/installer.php on line 19


has anyone else had a similar problem??

Thanks,
Mike
Thorsten
Posts: 15741
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

do you have Safe Mode activated?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
mike_s
Posts: 10
Joined: Thu Dec 02, 2004 8:15 pm

Post by mike_s »

No, safe_mode is off.

here is my phpinfo: http://www.candlescience.com/test.php
Thorsten
Posts: 15741
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

would it be possible to disable the Zend Optimizer? This could be a problem...

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply