Page 1 of 1

Cache Folder IIS

Posted: Sat Nov 06, 2021 9:33 pm
by spd2612
I have disabled the error reporting that Meteotemplate throws if cache folder is no writeable, how ever the warning is still there if i inspect the page. something is wrong here
Warning shows it deletes and recreates the same date file
Is there anyone that has found why this happens or how to fix
attached you will see my cache folder and also the error from the browser
You can see that its writeable by the file structure
errors.jpg
errors.jpg (110.98 KiB) Viewed 5056 times
cache folder.jpg
cache folder.jpg (46.99 KiB) Viewed 5056 times

Re: Cache Folder IIS

Posted: Sun Nov 07, 2021 12:29 pm
by Daali
I guess whatever system user PHP is using has a rights issue?

Re: Cache Folder IIS

Posted: Tue Nov 09, 2021 2:58 pm
by davidefa
The warning you reported is relative to the homepage/blocks/summary/cache folder.
You can try the following:
- extract the attached scripts in your homepage/blocks/summary folder
- from the browser execute the unlink1.php script ( https://hurricanepub.com/homepage/block ... nlink1.php )
- this should delete the homepage/blocks/summary/cache/yesterday.txt file, using a relative path to the file, in the same way as the summary block does ( and it should not work, as it does not work in the summary block )
- from the browser execute the unlink2.php script ( https://hurricanepub.com/homepage/block ... nlink2.php )
- this should delete the homepage/blocks/summary/cache/yesterday.txt file, using an absolute path to the file ( hope it works )
a) if both scripts fail you should have problems with folder permission
b) if the unlink2.php succeeds you should have problems with file access using relative paths

P.S.
In any case you should have similar problems with other blocks/plugins that use a cache folder ( they generally fail without reporting anything )

Re: Cache Folder IIS

Posted: Sat Nov 13, 2021 10:39 pm
by spd2612
Well I did not see your replys Thank you for them

However IIS and PHP are very funny the way they play togeather
I did this

created a simple PHP file on the concerned website. The content of this file was:

<?php var_dump(ini_get('fastcgi.impersonate')); ?>

I Navigated to this file using a browser.



My browser shows :

string(1) "1"

I ran this from cmd prompt

%windir%\system32\inetsrv\appcmd.exe list config "My Web Site" ^
/section:anonymousAuthentication

And to my surprise PHP was not running on the APP Pool for that site
here is the return from cmd prompt

<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="true" userName="IUSR" />
</authentication>
</security>
</system.webServer>

So I added IUSER to the cache folder and gave it write permissions

Then uncomented the lines in indexDesktop.php Now its all good
I guess just because the web site runs under its appPool, that does not mean PHP BACK END GOES THE SAME WAY

I got this info from a different source but here it is if anyone needs it

Code: Select all

The first thing to do is to create a simple PHP file on the concerned website. (It's important to create the file on the concerned website because each website can have a different setting.) The content of this file should be:

<?php var_dump(ini_get('fastcgi.impersonate')); ?>
Navigate to this file using a browser.

** Case 1 **

If your browser shows :

string(1) "1"
Then, you need to execute the following command (you need to replace "Default Web Site" by the name you gave to your website in IIS) :

%windir%\system32\inetsrv\appcmd.exe list config "Default Web Site" ^
/section:anonymousAuthentication
You will receive an answer which looks like this :

<system.webServer>
  <security>
    <authentication>
      <anonymousAuthentication enabled="true" userName="IUSR" />
    </authentication>
   </security>
</system.webServer>
The information you are looking for is the value of the username attribute of the anonymousAutthentification tag.

If this value is not empty, its content is the name of the user you need to give write permissions to.
If this value is empty or if the attribute is simply missing, you need to give write permissions to IIS AppPool\AppPoolName (replace "AppPoolName" with the name of your website's application pool).
** Case 2 **

If your browser shows :

string(1) "0"
You need to give write permissions to IIS AppPool\AppPoolName (replace "AppPoolName" with the name of your website's application pool).

Re: Cache Folder IIS

Posted: Sat Nov 13, 2021 10:42 pm
by davidefa
Thanks for sharing

Re: Cache Folder IIS

Posted: Sat Nov 13, 2021 11:59 pm
by spd2612
davidefa wrote: Sat Nov 13, 2021 10:42 pm Thanks for sharing
I have been running IIS servers since the early 90’s and Microsoft just wont leave crap alone
Whats the point of being able to pick a app pool to run iis under if you still have to manually add credentials for php to use for non default permissions