<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Omega2+ PHP7 Sessions not working]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I am not able to get PHP7 Sessions working on my Omega2+, when I run this php script from a browser:<br />
&lt;?php<br />
session_start();<br />
?&gt;<br />
I get the following error message:</p>
<p dir="auto">Fatal error: Uncaught Error: Call to undefined function session_start() in /www/Sessions/demo_session1.php:2 Stack trace: #0 {main} thrown in /www/Sessions/demo_session1.php on line 2</p>
<p dir="auto">I have php7,  php7-mod-session, php7-cgi, php7-cli, php7-fastcgi installed.  I am able to run other php/html scripts with no problems.  When I run phpinfo() in the script (session_start(); commented out) it appears the sessions is enabled...   '--enable-session=shared'.</p>
<p dir="auto">Any help on this would be greatly appreciated.</p>
<p dir="auto">Paul</p>
]]></description><link>http://community.onion.io/topic/3141/omega2-php7-sessions-not-working</link><generator>RSS for Node</generator><lastBuildDate>Thu, 21 May 2026 01:32:11 GMT</lastBuildDate><atom:link href="http://community.onion.io/topic/3141.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 13 Sep 2018 19:28:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Omega2+ PHP7 Sessions not working on Thu, 13 Sep 2018 19:28:35 GMT]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I am not able to get PHP7 Sessions working on my Omega2+, when I run this php script from a browser:<br />
&lt;?php<br />
session_start();<br />
?&gt;<br />
I get the following error message:</p>
<p dir="auto">Fatal error: Uncaught Error: Call to undefined function session_start() in /www/Sessions/demo_session1.php:2 Stack trace: #0 {main} thrown in /www/Sessions/demo_session1.php on line 2</p>
<p dir="auto">I have php7,  php7-mod-session, php7-cgi, php7-cli, php7-fastcgi installed.  I am able to run other php/html scripts with no problems.  When I run phpinfo() in the script (session_start(); commented out) it appears the sessions is enabled...   '--enable-session=shared'.</p>
<p dir="auto">Any help on this would be greatly appreciated.</p>
<p dir="auto">Paul</p>
]]></description><link>http://community.onion.io/post/17674</link><guid isPermaLink="true">http://community.onion.io/post/17674</guid><dc:creator><![CDATA[Paul Smulders]]></dc:creator><pubDate>Thu, 13 Sep 2018 19:28:35 GMT</pubDate></item><item><title><![CDATA[Reply to Omega2+ PHP7 Sessions not working on Fri, 14 Sep 2018 08:39:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/5112">@Paul-Smulders</a><br />
What is listed under "list interpreter" in /etc/config/uhttpd ?</p>
]]></description><link>http://community.onion.io/post/17683</link><guid isPermaLink="true">http://community.onion.io/post/17683</guid><dc:creator><![CDATA[Jon Gordon]]></dc:creator><pubDate>Fri, 14 Sep 2018 08:39:47 GMT</pubDate></item><item><title><![CDATA[Reply to Omega2+ PHP7 Sessions not working on Fri, 14 Sep 2018 17:08:08 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for replying Jon,  list interpreter is:</p>
<pre><code>list interpreter ".php=/usr/bin/php-cgi"
</code></pre>
<p dir="auto">Note: the Omega's firmware is 0.1.10 b160</p>
<p dir="auto">Best Regards,<br />
Paul</p>
]]></description><link>http://community.onion.io/post/17685</link><guid isPermaLink="true">http://community.onion.io/post/17685</guid><dc:creator><![CDATA[Paul Smulders]]></dc:creator><pubDate>Fri, 14 Sep 2018 17:08:08 GMT</pubDate></item><item><title><![CDATA[Reply to Omega2+ PHP7 Sessions not working on Sat, 15 Sep 2018 01:35:20 GMT]]></title><description><![CDATA[<p dir="auto">Can you post the code of the demo_session1.php page and also do a phpinfo() and see what it says for session. Also, you could try:</p>
<pre><code>if (extension_loaded('session')) {
    echo "Session Loaded";
    }
</code></pre>
<p dir="auto">I also see you have php cli installed... are you using it? What happens if you uninstall cli and restart with only cgi installed?</p>
]]></description><link>http://community.onion.io/post/17686</link><guid isPermaLink="true">http://community.onion.io/post/17686</guid><dc:creator><![CDATA[Jon Gordon]]></dc:creator><pubDate>Sat, 15 Sep 2018 01:35:20 GMT</pubDate></item><item><title><![CDATA[Reply to Omega2+ PHP7 Sessions not working on Sat, 15 Sep 2018 20:46:37 GMT]]></title><description><![CDATA[<p dir="auto">Hello Jon,</p>
<p dir="auto">I have removed the php7-cli but the result is the same error message as above.  The demo_session1.php script is pretty bare-bones:</p>
<p dir="auto">?php<br />
session_start();<br />
//phpinfo();</p>
<p dir="auto">?&gt;<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;body&gt;<br />
&lt;h1&gt; Testing ... Session &lt;/h1&gt;<br />
&lt;?php<br />
echo "Current script owner is: " . getmypid();<br />
?&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p dir="auto">I have tried the phpinfo() ... without the session_start() ... and it comes back with a lot of info, I'm not sure where to look for session issues ?  Also, the  getmypid() returns an int and</p>
<p dir="auto">if (extension_loaded('session')) {<br />
echo "Session Loaded";<br />
}else{<br />
echo "Session not loaded";<br />
}</p>
<p dir="auto">displays ... "Session not loaded"  (when the session_start() is commented out of course).</p>
<p dir="auto">My end objective in this is to have php identify the user accessing the file so that I can have the script respond differently depending on the user.  Unless there's another way to uniquely identify a user without using session.</p>
<p dir="auto">Best Regards,<br />
Paul</p>
]]></description><link>http://community.onion.io/post/17688</link><guid isPermaLink="true">http://community.onion.io/post/17688</guid><dc:creator><![CDATA[Paul Smulders]]></dc:creator><pubDate>Sat, 15 Sep 2018 20:46:37 GMT</pubDate></item><item><title><![CDATA[Reply to Omega2+ PHP7 Sessions not working on Sat, 15 Sep 2018 21:12:54 GMT]]></title><description><![CDATA[<p dir="auto">The first line should be</p>
<pre><code>&lt;?PHP
</code></pre>
<p dir="auto">not</p>
<pre><code>?PHP
</code></pre>
<p dir="auto">When doing the phpinfo(), just ctrl+f in your browser and search for "session" there should be a whole section if it's installed.</p>
<p dir="auto">It seems odd that session not loaded is returned from extension_loaded... it should be loaded regardless if you use it or not.</p>
<p dir="auto">Have you tried re-installing the session module with opkg and then restarting with</p>
<pre><code>/etc/init.d/uhttpd restart
</code></pre>
<p dir="auto">in the command line?</p>
]]></description><link>http://community.onion.io/post/17689</link><guid isPermaLink="true">http://community.onion.io/post/17689</guid><dc:creator><![CDATA[Jon Gordon]]></dc:creator><pubDate>Sat, 15 Sep 2018 21:12:54 GMT</pubDate></item><item><title><![CDATA[Reply to Omega2+ PHP7 Sessions not working on Tue, 18 Sep 2018 14:41:32 GMT]]></title><description><![CDATA[<p dir="auto">Hello Jon,</p>
<p dir="auto">Really appreciate your help on this.</p>
<p dir="auto">The missing &lt; in &lt;?php was a copying mistake, it's there...</p>
<p dir="auto">I've checked the phpinfo() file but there's no section on Sessions,<br />
just:</p>
<p dir="auto">'--enable-session=shared' in the Configure Command section<br />
Additional .ini files parsed	/etc/php7/20_session.ini</p>
<p dir="auto">in the standard section....<br />
session.trans_sid_hosts	no value	no value<br />
session.trans_sid_tags	a=href,area=href,frame=src,form=	<br />
a=href,area=href,frame=src,form=</p>
<p dir="auto">int the Environment section ...<br />
SCRIPT_NAME	/Sessions/sessions.php<br />
SCRIPT_FILENAME	/www/Sessions/sessions.php<br />
REQUEST_URI	/Sessions/sessions.php</p>
<p dir="auto">I have removed and re-installed php7-mod-session, rebooted, and performed an uhttpd restart ... to no avail, error message still there when opening page...</p>
<p dir="auto">Maybe removing all PHP7 packages and re-installing will resolve this,  otherwise ??</p>
<p dir="auto">Best Regards,<br />
Paul</p>
]]></description><link>http://community.onion.io/post/17707</link><guid isPermaLink="true">http://community.onion.io/post/17707</guid><dc:creator><![CDATA[Paul Smulders]]></dc:creator><pubDate>Tue, 18 Sep 2018 14:41:32 GMT</pubDate></item><item><title><![CDATA[Reply to Omega2+ PHP7 Sessions not working on Tue, 18 Sep 2018 23:18:18 GMT]]></title><description><![CDATA[<p dir="auto">if you are creating a php page with the following code:</p>
<pre><code>&lt;?php
// Show all information, defaults to INFO_ALL
phpinfo();
?&gt;
</code></pre>
<p dir="auto">and you view the page, and do not have a section named "session" as shown below:<br />
<img src="/assets/uploads/files/1537307625605-untitled-1-resized.png" alt="0_1537307468971_Untitled-1.png" class="img-responsive img-markdown" /></p>
<p dir="auto">Go to /usr/lib/php/ ... is there a <a href="http://session.so" rel="nofollow">session.so</a> file in there?</p>
<p dir="auto">Unless there is some funky file/folder permission issue here... I really don't know. If you installed session module it should be enabled by default.</p>
<p dir="auto">I guess you could try getting rid of everything php and doing an opkg update and then re-install php7 php7-cgi php7-mod-session... I don't know what else to suggest.</p>
]]></description><link>http://community.onion.io/post/17711</link><guid isPermaLink="true">http://community.onion.io/post/17711</guid><dc:creator><![CDATA[Jon Gordon]]></dc:creator><pubDate>Tue, 18 Sep 2018 23:18:18 GMT</pubDate></item><item><title><![CDATA[Reply to Omega2+ PHP7 Sessions not working on Wed, 19 Sep 2018 21:13:14 GMT]]></title><description><![CDATA[<p dir="auto">Hello Jon,<br />
I've looked into the <a href="http://session.io" rel="nofollow">session.io</a> file and it has a bunch gibber and a message half way through indicating:<br />
<strong>Session is not active<br />
Cannot call default session handler ss<br />
php-7.2.9/ext/session/mod_user_class.c<br />
Parent session handler is not open<br />
S SS</strong>  and much more (not able to copy it out of Atom editor ....)</p>
<p dir="auto">The result of phpinfo() call does not give a section labeled session as you've posted.</p>
<p dir="auto">I'm running php7 (7.1.1-1) php-cgi (7.1.1) and php-mod-session (7.2.4-2).  I've tried re-installing php7, php-cgi and php7-mod-session and rebooting, no luck.  Tried removing and re-installing the above packages all with ver 7.2.9-3 and rebooting ... but then I get a browser error: <strong>Bad Gateway<br />
The process did not produce any response.</strong></p>
<p dir="auto">Luckily, I have a firmware back-up on a USB stick so I can restore the Omega2+ to its previous working state (ie my php script is working but not the simple sessions script).</p>
<p dir="auto">It appears I'm out of luck with PHP Sessions and the Omega .... I'll have to find another way to identify a user...</p>
<p dir="auto">Thanks for the help,<br />
Best Regards,<br />
Paul</p>
]]></description><link>http://community.onion.io/post/17725</link><guid isPermaLink="true">http://community.onion.io/post/17725</guid><dc:creator><![CDATA[Paul Smulders]]></dc:creator><pubDate>Wed, 19 Sep 2018 21:13:14 GMT</pubDate></item><item><title><![CDATA[Reply to Omega2+ PHP7 Sessions not working on Thu, 20 Sep 2018 03:58:33 GMT]]></title><description><![CDATA[<p dir="auto">So here is what I did, with an Omega2+ and an arduino2 dock that I keep around for testing.<br />
This gave me a default Omega-Ware version of VS 0.1.10 b160</p>
<ul>
<li>
<p dir="auto">I did a factory reset on the module by holding down reset for 10s. (Then waited for 5-10 min while it setup)</p>
</li>
<li>
<p dir="auto">go through setup wizard to set wireless and console using <code>omega-XXXX.local/setup-wizard</code></p>
</li>
<li>
<p dir="auto">Install editor and terminal</p>
</li>
<li>
<p dir="auto">Using terminal command line:<br />
run <code>opkg update</code><br />
run <code>opkg install php7 php7-cgi php7-mod-session</code></p>
</li>
<li>
<p dir="auto">Using editor:<br />
change <code>/etc/config/uhttpd</code> to include the following lines at the bottom of the top section:<br />
<code>list interpreter ".php=/usr/bin/php-cgi"</code><br />
<code>option index_page 'index.php'</code></p>
</li>
<li>
<p dir="auto">Using Terminal command line:<br />
restart server with <code>/etc/init.d/uhttpd restart</code> command</p>
</li>
<li>
<p dir="auto">Using Editor:<br />
create new folder <code>/www/phptest/</code><br />
create new file <code>/www/phptest/phpinfo.php</code><br />
add the following code to <code>phpinfo.php</code> and save it:</p>
<pre><code>&lt;?PHP
   session_start();
   echo session_id();
   phpinfo();
?&gt;
</code></pre>
</li>
<li>
<p dir="auto">With your browser (I am using Chrome, <em>with cookies enabled</em>) go to: <code>http://omega-XXXX.local/phptest/phpinfo.php</code></p>
</li>
</ul>
<p dir="auto">I have used this setup on at least 15 different Omega2+ modules and they all worked without issue, please try this and let me know what happens.</p>
]]></description><link>http://community.onion.io/post/17726</link><guid isPermaLink="true">http://community.onion.io/post/17726</guid><dc:creator><![CDATA[Jon Gordon]]></dc:creator><pubDate>Thu, 20 Sep 2018 03:58:33 GMT</pubDate></item><item><title><![CDATA[Reply to Omega2+ PHP7 Sessions not working on Thu, 20 Sep 2018 15:57:16 GMT]]></title><description><![CDATA[<p dir="auto">Hello Jon,</p>
<p dir="auto">Thank you very much, followed your instructions and php session is working (was a bit reluctant to perform a factory reset on the Omega... but it was worth it).</p>
<p dir="auto">Now I need to restore the old omega's program/files and see if session still works.</p>
<p dir="auto">Best Regards,<br />
Paul</p>
]]></description><link>http://community.onion.io/post/17730</link><guid isPermaLink="true">http://community.onion.io/post/17730</guid><dc:creator><![CDATA[Paul Smulders]]></dc:creator><pubDate>Thu, 20 Sep 2018 15:57:16 GMT</pubDate></item><item><title><![CDATA[Reply to Omega2+ PHP7 Sessions not working on Fri, 21 Sep 2018 03:41:26 GMT]]></title><description><![CDATA[<p dir="auto">No problem, happy you got it working!</p>
]]></description><link>http://community.onion.io/post/17738</link><guid isPermaLink="true">http://community.onion.io/post/17738</guid><dc:creator><![CDATA[Jon Gordon]]></dc:creator><pubDate>Fri, 21 Sep 2018 03:41:26 GMT</pubDate></item></channel></rss>