marty.net 1001 Postcards Love Love Love Meep Meep ZenZodiac DailyQuotation

YOU ARE HERE:
Problem with PHP embedding

HOME

CPSHOP|

|

|

EMAIL MARTY
  marty.net message board
  « Problem with PHP embedding »
Welcome, Guest. Please Login or Register.
12/15/17 at 06:32:41
Home Help Search Login Register
   marty.net message board
   About cpshop
   Customization Help
   Problem with PHP embedding
(Moderator: Marty)
Pages: 1 Reply Notify of replies Send the topic Print 
   Author  Topic: Problem with PHP embedding  (Read 1585 times)
gfxmonkey
Green Dragon
*

Posts: 6



Go Scots!
   

E-Mail
Problem with PHP embedding
« on: 01/10/07 at 16:03:02 »
Reply with quote Modify message

I"m trying to embed cpshop into a php page and can only sort of get it working.  I'm getting this error once i embed it:

Content-Type: text/plain /store/index.php The configuration file (index.php.config) has not been generated. Please run cpadmin before proceeding.

The main menu works, but none of the subsequent pages work.  I can duplicate the config and call it index.php, but that seems silly to have to keep duplicating the config file every time i need to edit things.  

Is there a good way around this?  I was looking into a symbolic link from the original config file, but i don't think that will work.

Thanks,

- D
Logged
palmetto
Green Dragon
*

Posts: 10



Doh!
   

Re: Problem with PHP embedding
« Reply #1 on: 02/16/07 at 08:21:53 »
Reply with quote Modify message

I had the same problem and using a symbolic link worked for me. Your mileage may vary.
« Last Edit: 02/16/07 at 08:22:19 by palmetto » Logged
curmudgeony
Green Dragon
*

Posts: 9



Go Scots!
   

E-Mail
Re: Problem with PHP embedding
« Reply #2 on: 10/24/07 at 11:18:58 »
Reply with quote Modify message

I too have been having the same problem, I mentioned it back in sept on the install tutorial page, but didn't get an answer.

The holidays are coming.

HELP!
Logged
Marty
Administrator Dragon
*****

Gender: male
Posts: a whole lot



That's me. :)
   

WWW E-Mail
Re: Problem with PHP embedding
« Reply #3 on: 10/24/07 at 12:50:38 »
Reply with quote Modify message

Which version are you currently using?
Logged

--
Regards,
Marty..`..-> marty@marty.net
curmudgeony
Green Dragon
*

Posts: 9



Go Scots!
   

E-Mail
Re: Problem with PHP embedding
« Reply #4 on: 10/24/07 at 14:27:52 »
Reply with quote Modify message

pardon me, I should have mentioned it
I'm using the 2.6.beta7
Logged
Marty
Administrator Dragon
*****

Gender: male
Posts: a whole lot



That's me. :)
   

WWW E-Mail
Re: Problem with PHP embedding
« Reply #5 on: 10/26/07 at 11:19:03 »
Reply with quote Modify message

A few people have mentioned this problem, but I'm unable to duplicate it.  If someone experiencing it can send me login info, I might be able to root it out.  (Maybe a server config correlation?)
Logged

--
Regards,
Marty..`..-> marty@marty.net
sirbubba
Green Dragon
*

Posts: 7



Go Scots!
   

Re: Problem with PHP embedding
« Reply #6 on: 01/15/08 at 01:04:49 »
Reply with quote Modify message

I think it has to do with the PHP Server API used.  My local machine is using ServerAPI: Apache, while my hostmonster account is using ServerAPI:CGI/FastCGI.

ServerAPI: Apache runs PHP as an apache module, whereas ServerAPI:CGI/FastCGI runs PHP through CGI.... or something like that.

Since I can't modify Apache settings, I modified cpdata.lib line 1450.

OLD:
if (@ARGV && !$ENV{'QUERY_STRING'}) {

NEW:
 if (@ARGV) { # && !$ENV{'QUERY_STRING'}) {

Basically in the non-working instance QUERY_STRING was not empty, and so the ARGS couldn't reset the proper variables in the code following this IF.  Went straight to the Error call.

It's a very strange thing, because I did a lot of debugging (ie. lots of prints in various places) and it appears that the QUERY_STRING in the working instance gets set to "blank" whereas in the non-working instance, it gets set to the actual querystring.  And this is even before any code gets run.  

Disabling the empty QUERY_STRING check  in cpdata.lib doesn't seem to affect anything.
« Last Edit: 01/15/08 at 01:08:30 by sirbubba » Logged
dreamwhisper
Gold Dragon
****

Posts: 119



aDreamWhisperer
   

WWW
Re: Problem with PHP embedding
« Reply #7 on: 06/30/11 at 03:54:41 »
Reply with quote Modify message

Ok, I've been over and over the forums trying to figure this out.  I'm running 2.7i on a VPS and followed the instructions on setting up to run wrapped in php.  My main page data displays.  But all subsequent pages give:
Content-Type: text/plain /index.php The configuration file (index.php.config) has not been generated. Please run cpadmin before proceeding.

A URI like http://adreamwhisperer.com/shop/designshop.pl?i=flowers works.


Code:
<?php

     $qs = urlencode($HTTP_SERVER_VARS['QUERY_STRING']);
     $str = `/home/dreamwhi/public_html/adreamwhisperer.com/shop/designshop.pl "http://adreamwhisperer.com/gift-shop/" http://adreamwhisperer.com/shop/designshop.pl $qs`;
     
     echo $str;
     
?>


« Last Edit: 06/30/11 at 15:14:27 by dreamwhisper » Logged
dreamwhisper
Gold Dragon
****

Posts: 119



aDreamWhisperer
   

WWW
Re: Problem with PHP embedding
« Reply #8 on: 06/30/11 at 18:02:07 »
Reply with quote Modify message

NM thought I had a fix. Alas...
« Last Edit: 06/30/11 at 18:18:25 by dreamwhisper » Logged
dreamwhisper
Gold Dragon
****

Posts: 119



aDreamWhisperer
   

WWW
Re: Problem with PHP embedding
« Reply #9 on: 07/02/11 at 13:18:26 »
Reply with quote Modify message

So, I have it sort of working, except I have to replicate and rename the config file.  So, designshop.pl.config must be named designshop.php.config in the shop folder.  It isn't ideal as I must remember to duplicate the file everytime I make an admin change.  

What changes need to be made to 1) get the script to acknowledge a file outside of the script folder and 2) eliminate the need for duplication of the config file?
Logged
dreamwhisper
Gold Dragon
****

Posts: 119



aDreamWhisperer
   

WWW
Re: Problem with PHP embedding
« Reply #10 on: 07/02/11 at 20:51:36 »
Reply with quote Modify message

ok, so I have it working without duplicating my config file.  The issue? query strings.  I had to set it to use clean urls.  That in itself is a good thing.  

However, the urls must contain the index.php file name.  

Doesn't work:

Code:
$qs = urlencode($HTTP_SERVER_VARS['QUERY_STRING']);
     $str = `/home/dreamwhi/public_html/adreamwhisperer.com/shop/designshop.pl http://adreamwhisperer.com/shop http://adreamwhisperer.com/shop/designshop.pl $qs`;
     
     echo $str;


Works

Code:
$qs = urlencode($HTTP_SERVER_VARS['QUERY_STRING']);
     $str = `/home/dreamwhi/public_html/adreamwhisperer.com/shop/designshop.pl http://adreamwhisperer.com/shop/index.php http://adreamwhisperer.com/shop/designshop.pl $qs`;
     
     echo $str;
Logged
Pages: 1 Reply Notify of replies Send the topic Print 
Jump to:


marty.net message board (http://www.marty.net/cgi/marty/board/messageboard)

Powered by YaBB 1 Gold - Release (Yet Another Bulletin Board)
Copyright 2000-2001, X-Null. All Rights Reserved.