Note that there are some explanatory texts on larger screens.

plurals
  1. POphp code works with mamp but not on ubuntu server
    text
    copied!<p>I have start looking at a twitter php library <a href="http://github.com/abraham/twitteroauth" rel="nofollow noreferrer">http://github.com/abraham/twitteroauth</a>, but i can't get it to work on my ubuntu server, but on my mac, with mamp it works without any problems.</p> <p>This is the code that don't won't to work on my server, but in mamp. Yes i have edit config file</p> <pre><code>&lt;?php /* Start session and load library. */ session_start(); require_once('twitteroauth/twitteroauth.php'); require_once('config.php'); /* Build TwitterOAuth object with client credentials. */ $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET); /* Get temporary credentials. */ $request_token = $connection-&gt;getRequestToken(OAUTH_CALLBACK); /* Save temporary credentials to session. */ $_SESSION['oauth_token'] = $token = $request_token['oauth_token']; $_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret']; /* If last connection failed don't display authorization link. */ switch ($connection-&gt;http_code) { case 200: /* Build authorize URL and redirect user to Twitter. */ $url = $connection-&gt;getAuthorizeURL($token); header('Location: ' . $url); break; default: /* Show notification if something went wrong. */ echo 'Could not connect to Twitter. Refresh the page or try again later.'; } </code></pre> <p>I have enable php session on my ubuntu server, because this code works</p> <pre><code>&lt;?php session_start(); $_SESSION["secretword"] = "hello there"; $secretword = $_SESSION["secretword"] ; ?&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;A PHP Session Example&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;?php echo $secretword; ?&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload