function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mike @ PartnersMike @ Partners 

SSL problem

I have created a online app that works with salesforce. I got everything working perfectly, but when I add the SSL "https:" onto the url I get errors. But i only get errors when it is trying to interact with salesforce. The first part, where it is logging into salesforce it doesn’t like any of the 'Try' commands I have. That error looks like this:

Code:
Parse error: parse error, unexpected '{' in ourwebsite/PW-loginRegister.php on line 8

 
 So I deleted all of the '{' or '}' that weren’t need, they happened to be the 'TRY' commands, and then I get this error:
Code:
Parse error: parse error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in ourwebsite/soapclient/SforcePartnerClient.php on line 39

 

Any ideas on where i am going wrong would be very helpful.

 

Here is the code for the login page:

Code:
<—php
require_once ('../../salesforce/soapclient/SforcePartnerClient.php');
include ('header.inc');
session_start();
function login($username, $password) {
   $wsdl = '../../salesforce/partner.wsdl.xml';
   $loginResult = null;
   try {
     $mySforceConnection = new SforcePartnerClient();
     $mySforceConnection->createConnection($wsdl);
     $loginResult = $mySforceConnection->login($username, $password);

     $_SESSION['location'] = $mySforceConnection->getLocation();
     $_SESSION['sessionId'] = $mySforceConnection->getSessionId();
     $_SESSION['wsdl'] = $wsdl;

   } catch (Exception $e) {
     global $errors;
     $errors = $e->faultstring;
    print($errors);
   }
   return $loginResult;
}
 try {
$result = login('username', 'userpass'); if (isset($result)) {
         session_write_close();

$Campign_Num = $_GET['Campign_Num'];
$Monthname = $_GET['Monthname'];
$Monthnum = $_GET['Monthnum'];
$daynum = $_GET['daynum'];
$year = $_GET['year'];
$City = $_GET['City'];
$State = $_GET['State'];

header('Location: PW_Agreement.php–Campign_Num='. 
$Campign_Num.'&Monthname='.$Monthname.'&Monthnum='. 
$Monthnum.'&daynum='.$daynum.'&year='.$year.'&City='.$City.'&State='. 
$State);
         exit();
       }}
  catch (Exception $e) {
       print_r($e);    }

include ('footer.inc');
˜>

 

Also if I skip this page and have the SSL start on a page after this everything works find till I try and make a call to salesforce. It gives me the error the i have an extra '{'

 

Any ideas would be very helpful, thank you for your help,

Mike

 
 
 

Message Edited by Mike @ Partners on 09-13-2006 01:29 PM

Mike @ PartnersMike @ Partners
So i got the first problem worked out. Our hosting company messed up the SSL set up.
Now i am getting this error. I have no idea if this is the Hosing company causing the proublem agian or if this is salesforce and i need to add some code to my API log in.
Here is the error:
 
Warning: session_start() [function.session-start]: open(/tmp/sess_7090a51671d41b3aabf5badf01b7a37c, O_RDWR) failed: Permission denied (13) in /home/www/ourwebsite/Salesforce/PW-loginRegister.php on line 4

Warning: session_write_close() [function.session-write-close]: open(/tmp/sess_7090a51671d41b3aabf5badf01b7a37c, O_RDWR) failed: Permission denied (13) in /home/www/ourwebsite/Salesforce/PW-loginRegister.php on line 27

Warning: session_write_close() [function.session-write-close]: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in /home/www/ourwebsite/Salesforce/PW-loginRegister.php on line 27
 
 
I get this error when i am trying to login so i can make calls.
Any ideas would be helpfull.
Thank you,
Mike
 
 
 
 

Message Edited by Mike @ Partners on 09-14-2006 11:15 AM

Message Edited by Mike @ Partners on 09-14-2006 11:16 AM

Tran ManTran Man
This is most likely a file permission problem in your env.  PHP is complaning it can't open or write to /tmp/.
dev_xlncedev_xlnce
Hello Everybody,

First of, Thank you for taking your time to read this.

I have the exact same problem.  The code works perfectly in my local machine (localhost) but when I put it in my host it complains that there is an error:

Parse error
: parse error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/sforce-php/soapclient/SforcePartnerClient.php on line 39

I removed the try {.....} and catch {.....} braces on other files when it happend, but i am lost as to what to do here.   I do not understand what you meant when you said PHP is complaining that it cannot open or write to /tmp/.  Actually i changed all the files to permission "777". But i cannot find "tmp" file in my hosts file or root directories.  My question is

How can i find my tmp folder? Where is the tmp folder?

Thank you. I really appreciate your input on this.



Mike @ PartnersMike @ Partners
This was a easy problem to fix. You need to contact your hosting provider and tell them you are having permissions problem to your temporary fold. This fold is created when you enter a SSL Site and it writes the SSL certificate code it to it. That is what is causing the problem. You don’t have permission to write that file so you get the error. If I remember right the permission you need is 777 or 744. I can’t remember exactly. Once the permissions problem is fixed it works great.
Hope this helps.
Mike