2

I have a virtual shared server through:

  • Godaddy
  • Plesk 11.0
  • Dreamweaver CS5
  • phpMyAdmin through Plesk.

I use XAMPP for my local server and all is great! I can connect locally and I also can connect to the phpMyAdmin dbase file via Dreamweaver. It's just when I upload the file to my remote server I get:

Warning: require_once(Connections/TestConn.php) [function.require-once]: failed to open stream: Operation not permitted in C:\Inetpub\vhosts\directory420.com\httpdocs\test.php on line 1
Fatal error: require_once() [function.require]: Failed opening required 'Connections/TestConn.php' (include_path='.;./includes;./pear') in C:\Inetpub\vhosts\directory420.com\httpdocs\test.php on line 1

I want my PHP registration form to be accessible to people that navigate to the page. I use XAMPP so I don't know why the Inetpub and vhost info shows up.

Francisco
  • 10,918
  • 6
  • 34
  • 45
  • PLEASE STOP WRITING TITLE IN ALL CAPITAL..... With that out, it feels great! Now let me read the question. – itachi Oct 22 '12 at 05:23
  • check the folder structure on server, have you put your TextConn.php file into Connections folder? – pkachhia Oct 22 '12 at 05:24
  • Check the file permissions on the server; it should be readable for all (e.g. `rwxr--r--`) – Ja͢ck Oct 22 '12 at 05:27

1 Answers1

0

Use absolute paths. You can use configuration files for this. Make a file named configuration.php, put it in some common location like DOCUMENT_ROOT/configutation.php. Add the absolute paths to this like

define('LIBRARY_ROOT','c:\xx\yy\');
define('CONNECTION_ROOT','c:\xx\yy\ZZZ');
.
.
define('GG.....

Use this constants in your code. Import the configuration file in the flow root. Its easy when you move from server to server.

Thanks

Kris
  • 8,680
  • 4
  • 39
  • 67
  • Thank you but writing script isn't my best asset – user1764306 Oct 23 '12 at 02:50
  • Thank you for your time K. I found the problem. In Plesk under php setting for "open_basedir" was set to "none" and I changed it to "deflaut" and wala I can access my remote file. I will do a youtube video on this. Thanks – user1764306 Oct 23 '12 at 06:44