Restricted fopen() and mysql access


#1

newbie from France here :slight_smile:

I had a domain parked here for years (email forwarding worked fine…) Now I just signed (yes promotion) for a code warrior plan.

I have some questions, these two for today :

  • fopen() seems not to work in my php files, but works in pcgi files. Do I understand the file functions are restricted like the exec and can’t be used in php as apache module, only in the cgi php ?

  • is it possible to access mysql databases from somewhere else (ie, to use an odbc connection from my local machine to backup/update tables). I tried a mysql_connect in php from another server without success (same works well from the hosted domain).

Thanx for any info on these subjects


#2

Dear Francois,

Yes, file manipulation must be carried out in .pcgi scripts. The Apache user (which runs .php scripts) does not have file permissions in your directories. The .pcgi scripts run as you, so you have all the permissions you need.

I cannot answer the MySQL question.

–David B.
“greendavid”


#3

[/quote]

Thanx, I already read that, unfortunately I suppose some functions (http authentication) are only availables in the .php files… So we need to juggle betwen these two versions of php, playing with includes, files extensions, etc :frowning:

BTW, is there any noticeable difference in performance between .php and .pcgi files ?


#4

As far as I can tell, the performance is the same. (Les deux sont Ă©gal!)

–David B.
“greendavid”