Hi,

Does anyone have experience with accessing PHPFox info using external PHP scripts? I've done it before using the following:

#cccccc;padding:5px 10px;"        define('PHPFOX_PARENT_DIR', __DIR__ . DIRECTORY_SEPARATOR);
    define('PHPFOX_NO_RUN', true);
    require('../PF.Base/start.php');

But with my script being inside another directory as you can see, I'm getting an error 500. It's not a PHPFox issue, I believe it's a PHP setting (I've already checked permissions, played with openbase_dir settings, etc, and it's one I've actually resolved in the past I just can't remember what I changed, so if anyone's had the same, or knows how do achieve the same using REST, I'd appreciate any tips

Be the first person to like this.
Paris

I ran a wordpress function library with old old phpfox version 3x in the past but today's phpfox setup it doesnt work anymore. I don't know why. Probably new directory permissions or folder rules? Not sure.

It doesn't work anymore.

 

On th eother hand this chat script i run it works. Boggles my head.

Are you running your external script in the same directory as phpfox? example: /public_html   or are you grabbing it from another directory /public_html/external?

 

Works best if it's in the same directory, example i run external script chat in same directory otherwise it can't grab needed files.

So I run it like this /public_html/chat      or even   /public_html/basedir/chat

I ran a wordpress function library with old old phpfox version 3x in the past but today's phpfox setup it doesnt work anymore. I don't know why. Probably new directory permissions or folder rules? Not sure.

Last update on February 1, 2021 by Paris.
Be the first person to like this.

Yeah, same directory, so if phpfox is in /httpdocs, my script is in /httpdocs/folder
I've put a php file in /httpdocs with the same code and that works, so there's nothing wrong with that, or accessing start.php itself. The issue seems to be from where I'm accessing it, so frustrating because something's telling me the fix before was really silly

 

Sorry for the flood reply, clicked it once, ended up with 3!

Last update on February 1, 2021 by LEthaLity.
Be the first person to like this.

Yeah, same directory, so if phpfox is in /httpdocs, my script is in /httpdocs/folder
I've put a php file in /httpdocs with the same code and that works, so there's nothing wrong with that, or accessing start.php itself. The issue seems to be from where I'm accessing it, so frustrating because something's telling me the fix before was really silly

Be the first person to like this.

Yeah, same directory, so if phpfox is in /httpdocs, my script is in /httpdocs/folder
I've put a php file in /httpdocs with the same code and that works, so there's nothing wrong with that, or accessing start.php itself. The issue seems to be from where I'm accessing it, so frustrating because something's telling me the fix before was really silly

Be the first person to like this.
JohnJr

I remember several years ago having an issue with getting the directory right " ../PF.Base/start.php ".  I remember trying three or four periods and even tried one period.  I don't remember how many periods I ended up with, but I was like it shouldn't be that but it was :)

Be the first person to like this.

I remember several years ago having an issue with getting the directory right " ../PF.Base/start.php ".  I remember trying three or four periods and even tried one period.  I don't remember how many periods I ended up with, but I was like it shouldn't be that but it was :)

Yeah I went through all of those variations the same time I was messing around with openbase_dir incase there was something going on. I think my initial hunch of it being something really stupid or small is likely, and that like last time, I had reinstalled half a dozen times, tried all sorts on the server config side to find out it's something within phpFox.

I've come to that conclusion since I can run php includes from my own scripts, including some placed with PF.Base, etc, and there's no issue there, so there's something going on between phpFox's config and start.php. Will update if I fix it for my own and others future sanity.

JohnJr

others future sanity...

LOL.

Be the first person to like this.