Problems getting selfoss running

by mdeeter, Saturday, March 16, 2013, 23:48 (4030 days ago)

Okay... I'll preface this with a disclaimer... I don't know much about php and mysql. I work mostly on Windows with classic asp and do mostly javascript development.

Here's the next thing I'm sure everyone here will balk at... I'm trying to run this on a GoDaddy shared hosting account... running Windows with IIS7 and PHP 5.3.

I'm trying to run it on mysql... I have the database set up and the config.ini has all of the connection data in it.


When I try to load selfoss in my browser, it returns an error:

Internal Server Error

Fatal error: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'

I also tried the sqlite, but it comes up with an error:

Internal Server Error

could not find driver


Any ideas?

Problems getting selfoss running

by polohb, Sunday, March 17, 2013, 09:28 (4030 days ago) @ mdeeter

For sqlite, you should install something like php-sqlite in addition to the php default install.

Problems getting selfoss running

by pumm3l, Tuesday, July 09, 2013, 15:06 (3916 days ago) @ mdeeter

Ever get this working? I was getting this same error and I fixed it by uncommenting this line in my php.ini

extension=php_pdo_mysql.dll

I tried as well to get this running on iis/php/mysql but I was having issues with the .htaccess rewriting wondering if you figured out how to solve this.

Problems getting selfoss running

by mdeeter, Tuesday, July 09, 2013, 15:48 (3916 days ago) @ pumm3l

I gave up when I didn't get an answer from the forum. I'm using Feedly... and I created a Chrome plugin to tweak it to include features I was looking for.

Problems getting selfoss running

by pumm3l, Tuesday, July 09, 2013, 16:13 (3916 days ago) @ mdeeter

Fair enough, thanks for the reply.

If you feel like looking at it again, I have it somewhat working. Still trying to figure some things out regarding the rewriting is IIS. For some reason it's not loading scripts or stylesheets within the page, however it does load fine if I hit it at http://localhost/all.css which is odd...

The htaccess file converted to url rewrite in IIS web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<clear />
<rule name="favicons" stopProcessing="true">
<match url="favicons/(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="data/favicons/{R:1}" />
</rule>
<rule name="thumbnails" stopProcessing="true">
<match url="thumbnails/(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="data/thumbnails/{R:1}" />
</rule>
<rule name="front controller" stopProcessing="true">
<match url=".(js|ico|gif|jpg|png|css|asc|txt|eot|woff|ttf|ttf|svg)$" ignoreCase="false" negate="true" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{QUERY_STRING}" pattern="^(.*)$" ignoreCase="false" />
</conditions>
<action type="Rewrite" url="index.php?{C:1}" appendQueryString="false" />
</rule>
<rule name="Rewrite" enabled="true" stopProcessing="true">
<match url="(.*)" negate="false" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" pattern="favicons/" negate="true" />
<add input="{REQUEST_FILENAME}" pattern="thumbnails/" negate="true" />
<add input="{REQUEST_FILENAME}" pattern="public/" negate="true" />
<add input="{REQUEST_FILENAME}" pattern="index.php" negate="true" />
</conditions>
<action type="Rewrite" url="public/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

Problems getting selfoss running

by pumm3l, Tuesday, July 09, 2013, 20:47 (3915 days ago) @ pumm3l

Just to update this in case anyone else stumbles on it.... my issue regarding the stylesheets and javascript not working in my previous reply was that the base url was not set in the config.ini file and was defaulting to https://localhost/ not sure why it does that but it was trying to load https://localhost/all.css and my dev server wasn't setup for ssl, i manually entered http://localhost and the stylesheets and scripts load fine.

The only issue I have now is that the app has slow performance, the page takes about 12 secs to load using PHP FASTCGI on iis 7.5, not sure why but I ended up giving up because I can get it to run fine with php/apache/mysql combo.

selfoss running on IIS 7

by matup, Friday, July 12, 2013, 05:35 (3913 days ago) @ pumm3l
edited by matup, Friday, July 12, 2013, 06:02

In order to work do the following changes:

1 - Point Web Site to public folder rather than the root folder.
2 - Create a "index.php" file in public folder width the following line:

<?php chdir('../'); include('index.php'); ?>
3 - Set the web.config with the following data:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Rewrite" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" pattern="^.*\.svg$|^.*\.ttf$|^.*\.css$|^.*\.js$|^.*\.jpg$|^.*\.jpeg$|^.*\.png$|^.*\.gif$|^.*\.ico$|^.*\.htm$|^.*\.html$|^.*\.txt$|^.*\.xml$|^.*\.xlsx$|^.*\.xls$|^.*\.swf$|^.*\.flv|^.*\.mp4|^.*\.ogg$" negate="true" />
</conditions>
<action type="Rewrite" url="index.php?{R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
<directoryBrowse enabled="false" />
<httpErrors errorMode="DetailedLocalOnly" defaultResponseMode="File"></httpErrors>
<staticContent>
<remove fileExtension=".ttf" />
<remove fileExtension=".svg" />
<mimeMap fileExtension=".ttf" mimeType="application/octet-stream" />
<mimeMap fileExtension=".svg" mimeType="application/octet-stream" />
</staticContent>
</system.webServer>
</configuration>

4 - Modify the file "controllers\Index.php" (around line 180) function "update" remove the comparison "$_SERVER['SERVER_ADDR'] != $_SERVER['REMOTE_ADDR']", because $_SERVER['SERVER_ADDR'] does not exists in IIS, or use LOCAL_ADDR instead.
5 - Add virtual directory "favicons" pointing to "<DIR>\data\favicons"
6 - Add virtual directory "thumbnails" pointing to "<DIR>\data\thumbnails"

7 - Enjoy!:-)

selfoss running on IIS 7

by pumm3l, Friday, July 12, 2013, 14:04 (3913 days ago) @ matup
edited by pumm3l, Friday, July 12, 2013, 14:34

thanks, I did confirm that your solution does work. I'm still getting poor performance using selfoss on iis7 though. No idea what that's about.

*edit*

ok figured out the slowness issue. I had mysql host set to localhost and I guess it was having a hard time resolving so I set it to 127.0.0.1 and now it loads quickly.

I was getting 404 errors with your setup trying to serve the .woff fonts, I reverted back to my web.config and everything works as expected. The web.config I have doesn't require you to create files or setup virtual directories and you point to the root folder rather than the public folder.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<clear />
<rule name="favicons" stopProcessing="true">
<match url="favicons/(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="data/favicons/{R:1}" />
</rule>
<rule name="thumbnails" stopProcessing="true">
<match url="thumbnails/(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="data/thumbnails/{R:1}" />
</rule>
<rule name="front controller" stopProcessing="true">
<match url=".(js|ico|gif|jpg|png|css|asc|txt|eot|woff|ttf|ttf|svg)$" ignoreCase="false" negate="true" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{QUERY_STRING}" pattern="^(.*)$" ignoreCase="false" />
</conditions>
<action type="Rewrite" url="index.php?{C:1}" appendQueryString="false" />
</rule>
<rule name="Rewrite" enabled="true" stopProcessing="true">
<match url="(.*)" negate="false" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" pattern="favicons/" negate="true" />
<add input="{REQUEST_FILENAME}" pattern="thumbnails/" negate="true" />
<add input="{REQUEST_FILENAME}" pattern="public/" negate="true" />
<add input="{REQUEST_FILENAME}" pattern="index.php" negate="true" />
</conditions>
<action type="Rewrite" url="public/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

selfoss running on IIS 7

by matup, Friday, July 12, 2013, 17:47 (3913 days ago) @ pumm3l

The problem with the different extensions depends on the configuration, adding the mime type, for those that does not exists it in the global configuration, into the local web.config file should solve the issue.

Any way, my idea was to isolate as much as possible the public from the application files and not rely on complex rewriting rules.

Best, Matias

RSS Feed of thread
powered by my little forum