![]() |
Another PHP little question
Hello guys,
Maybe someone can help me again with a PHP question. I have WEBSITE A and WEBSITE B In WEBSITE A I created a php file and I display the content on my index.php using this code: PHP Code:
PHP Code:
Code:
Warning: include(/home/username_website_a/public_html/block/content.php) [function.include]: failed to open stream: Permission denied in /home/username_website_b/public_html/index.php on line 45 But Im a newbie and I dont know If this is possible. Can someone help me please? :-) Thanks!! |
Hi,
try PHP Code:
PHP Code:
|
i think you should also check if you have safe_mode and open_basedir off or on..
|
Thank you for your replies mates!
adult-help, I have: open_basedir: no value safe_mode: off Do I need to put both of them on? Or just one of them? If yes, which one? And is secure to put them on? |
With this code you get the same error?
PHP Code:
|
The first thing you should do is prove to yourself that you have the right path to the file you want to include by checking it on the command line. Try typing this to if you a good response.
"ls -l /home/username_website_a/public_html/block/content.php". If you don't receive an error you've got the right path if an error is returned you need to get find the correct path. I would worry about .. or ../.. because it looks like you are using a full path. You would only need to those if you are using relative paths. php includes always makes more sense to me when I write it like this <?php include("/home/path/to/file/I/want.php"); ?> I use double quotes in case I want to use variables that way the variable get interpolated |
Check you file permissions inside the directory
/home/username_website_a/public_html/block/ block should be 755 or 777. 777 gives the outside would access to any file that is in there. What I did in the past with a similar issue was to use an external readfile statement. <? readfile("http://path A/index.php"); > Edit the code on site B Insert the above statement in place of your statement that would normal display your output in side B. Any changes made on site A will automatically show up on site B. Give it a shot. |
php includes!
Website B needs this adding: <?php include("hxxp://WebsiteA/want.php"); ?> that should do it! |
If they are two different users and PHP has been setup to restrict you to your own directory, the easiest way to have it work is to park the domain for website b onto website a then you can use relative references and also pay for one set of hosting
Good Luck Rob |
Does
<?php include '/home/username_website_a/public_html/block/content.php'; ?> work in website A as well ? |
All times are GMT -7. The time now is 10:35 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc