I am using this code to disable cache in php but this code is not working on any browser. Please somebody help me, I don't want to save php web page in cache memory  header('cache-control: no-cache,no-store,must-revalidate');  header('pragma: no-cache');  header('expires: 0');
122792
We are developing a Flash site with PHP. the problem is that it storing the cache , but we have to disable the cache using JavaScript or PHP.  How can I disable caching?
89561
I recently downloaded OpenSUSE OS version 11.4 from the site to use it as a server..In order to do that I downloaded the server edition that has Apache/2.2.17 and PHP5 downloaded by default.....Ok till now it is fine  Now I started the Apache successfully and put a test.php file in the documentRoot directory. test.php contain only &lt;?php phpinfo() ?&gt;  Then using my browser I typed http://localhost/test.php and here was the problem  the browser didn't display what phpinfo() should display, instead it asked me whether I want to open or save test.php...which is driving me crazy.... I googled a lot but no solution  THis is /etc/apache2/conf.d/php5.conf  &lt;IfModule mod_php5.c&gt;     AddHandler application/x-httpd-php .php4     AddHandler application/x-httpd-php .php5     AddHandler application/x-httpd-php .php     AddHandler application/x-httpd-php-source .php4s     AddHandler application/x-httpd-php-source .php5s     AddHandler application/x-httpd-php-source .phps     DirectoryIndex index.php4     DirectoryIndex index.php5     DirectoryIndex index.php &lt;/IfModule&gt;
56703
I want to block access to my web server by default as a precaution but I keep getting the following errors showing up in my error log.      [Wed Jun 27 23:30:54 2012] [error] [client 86.77.20.107] client denied by server configuration: /home/www/default/Edu.jar      [Wed Jun 27 23:32:40 2012] [error] [client 86.77.20.107] client denied by server configuration: /home/www/default/REST.jar      [Wed Jun 27 23:35:39 2012] [error] [client 86.77.20.107] client denied by server configuration: /home/www/default/Set.jar      [Thu Jun 28 01:01:17 2012] [error] [client 58.218.199.227] client denied by server configuration: /home/www/default/proxyheader.php      [Thu Jun 28 02:34:57 2012] [error] [client 58.218.199.227] client denied by server configuration: /home/www/default/proxy.php      [Thu Jun 28 05:41:33 2012] [error] [client 58.218.199.227] client denied by server configuration: /home/www/default/proxyheader.php      [Thu Jun 28 06:55:10 2012] [error] [client 180.76.6.20] client denied by server configuration: /home/www/default/      [Thu Jun 28 07:31:26 2012] [error] [client 86.77.20.107] client denied by server configuration: /home/www/default/Edu.jar      [Thu Jun 28 07:32:25 2012] [error] [client 86.77.20.107] client denied by server configuration: /home/www/default/REST.jar      [Thu Jun 28 07:36:10 2012] [error] [client 86.77.20.107] client denied by server configuration: /home/www/default/Set.jar   I don't really want these errors to show up but whatever I do, I can't get rid of them. Does anyone know how I can achieve this?  Here is a copy of my configuration.  &lt;VirtualHost *:80&gt;     DocumentRoot /home/www/default      &lt;Directory /&gt;            AllowOverride None            Order Deny,Allow            Deny from all     &lt;/Directory&gt;      #ErrorLog /var/log/apache2/error.log     #LogLevel warn     CustomLog /var/log/apache2/access.log combined &lt;/VirtualHost&gt;
90657
I wonder if there is an existing  module that can help in the subject. I am not looking for a caching module (like Boost or Varnish), but a way to export my whole site (or only certain pages) into static.  The idea is that I want my web server will be a very simple and light and will only serve static files (html/css/js) - no database on production, no php engine will be installed on server. All the Drupal engine will be on another server, export will be done each time adding/editing/changing a node or view, and a new set of html files will be created in a directory structure.  These files will later on be copied to the production site that will serve always and only static files, no .htaccess that will check requests if file exist etc.   Is there a module for that, or a workaround that this can be achieved with Drupal?  Thanks
53727
I'm building a small web app in PHP that stores some information in a plain text file. However, this text file is used/modified by all users of my app at some given point in time and possible at the same time.  So the questions is. What would be the best way to make sure that only one user can make changes to the file at any given point in time?
93631
Is it possible to write some C or C++ code and compile to binaries, then use those binaries with php? Is it also possible to write a php library using C and C++ ?  If so, please tell how can I do so?
6560
I have watched a video on youtube, I didn't close the browser window and it is buffered. I can watch that video anytime, without connecting to internet, as it is completely buffered. But I am not able to find the local cache for it, I checked the default folder of cache for my browser(chrome), which is: %AppData% Local\Google\Chrome\User Data\Default\Cache, but videos is not there. However it must be there somewhere in my local system as I am able to watch it again and again without connecting to internet. I used to get those previously, but something happen either it is saving in some other folder or what.  does anyone has any idea?
102
I have a very stupid question. I developed a website that has only one page at the public html directory(index.php).  all content are dynamically loaded as different pages.   How can i SEO my pages for google?  i mean like the what we type in this site are .............i believe stored in database and search engine find these pages like any static pages...  Just a little tip would be appreciable.......!
114665
When I want to execute a php file it's displayed as text in my browser.  I have a VPS at Hostinger I installed Ubuntu 18.04 with Webmin and LAMP(installed automatically).  I checked the installation see below.  apache2 - v and php -v gives me: Apache/2.4.29 and PHP 7.2.24-0ubuntu0.18.04.6  So everything seem to be installed correctly.  My default folder is /var/www/html/ I do not us short tag in my code.  I try to lunch a file called phpinfo.php with content:  &lt;?php phpinfo(); ?&gt;   And plain text appear on the page.  If the file begin with html code it's correctly rendered, even with a .php file. But the php part is not executed. e.g:  &lt;!DOCTYPE html&gt; &lt;html lang="en" dir="ltr"&gt;   &lt;head&gt;     &lt;meta charset="utf-8"&gt;     &lt;title&gt;&lt;/title&gt;   &lt;/head&gt;   &lt;body&gt;     &lt;h1&gt;Hello&lt;/h1&gt;   &lt;/body&gt; &lt;/html&gt;  &lt;?php phpinfo(); ?&gt;   Render :  Hello  But  &lt;?php phpinfo(); ?&gt;  &lt;!DOCTYPE html&gt; &lt;html lang="en" dir="ltr"&gt;   &lt;head&gt;     &lt;meta charset="utf-8"&gt;     &lt;title&gt;&lt;/title&gt;   &lt;/head&gt;   &lt;body&gt;     &lt;h1&gt;Hello&lt;/h1&gt;   &lt;/body&gt; &lt;/html&gt;   Render the code as plain text.
25802
Is it possible to save everypage you visit in a browser automatically? I do now want to rely on Cache as a huge cache will slow down the browser. A third party software or an add-on will be helpful.  I use Chrome browser, but any other browser which can help me in my requirement is okay.
54669
In my Ubuntu deployment script I have written a function to secure shared memory. For a web server it's important to secure the shared memory to tighten up security. Below you can find the code:  echo "tmpfs       /dev/shm     tmpfs   tdefaults,noexec,nosuid        0 0" &gt;&gt; /etc/fstab   When I reboot the web server it gets stuck. I can't see where it goes wrong. Do you have an idea, please let me know.
15283
I have a php file which I will be using as exclusively as an include. Therefore I would like to throw an error instead of executing it when it's accessed directly by typing in the URL instead of being included.  Basically I need to do a check as follows in the php file:  if ( $REQUEST_URL == $URL_OF_CURRENT_PAGE ) die ("Direct access not premitted");   Is there an easy way to do this?
33938
I have one of those "I swear I didn't touch the server" situations. I honestly didn't touch any of the php scripts. The problem I am having is that php data is not being saved across different pages or page refreshes. I know a new session is being created correctly because I can set a session variable (e.g. $_SESSION['foo'] = "foo" and print it back out on the same page just fine. But when I try to use that same variable on another page it is not set! Is there any php functions or information I can use on my hosts server to see what is going on?  Here is an example script that does not work on my hosts' server as of right now:  &lt;?php session_start(); if(isset($_SESSION['views']))     $_SESSION['views'] = $_SESSION['views']+ 1; else     $_SESSION['views'] = 1;  echo "views = ". $_SESSION['views']; echo '&lt;p&gt;&lt;a href="page1.php"&gt;Refresh&lt;/a&gt;&lt;/p&gt;'; ?&gt;   The 'views' variable never gets incremented after doing a page refresh. I'm thinking this is a  problem on their side, but I wanted to make sure I'm not a complete idiot first.  Here is the phpinfo() for my hosts' server (PHP Version 4.4.7):
1754
Basically, one of the greatest questions of all time: What are some ways you're using settings.php in your development/staging workflow?  Right now, I have my settings.php file set up like the following, and I base my development on the server's $HOST directive—meaning I can work on dev.example.com for the development (shared) server, local.example.com for my local computer (and other dev's local code checkouts), and www.example.com (or just example.com) for the live site.  (This code is in the 'Database settings' section of settings.php):       $host = $_SERVER['HTTP_HOST']; $base_url = 'http://'.$host; $cookie_domain = $host;  switch($host) {   case 'example.com': # Production server     $db_url = 'mysqli://prod_sql_user:password@127.0.0.1/prod_db';     $update_free_access = FALSE;     $conf = array (       // Set production config options here...       'example_setting' =&gt; 0,     );     break;    case 'dev.example.com': # Development server     $db_url = 'mysqli://dev_sql_user:password@127.0.0.1/dev_db';     $update_free_access = FALSE;     $conf = array (       // Set production config options here...       'example_setting' =&gt; 0,     );     break;    case 'local.example.com': # Local server     $db_url = 'mysqli://local_sql_user:password@127.0.0.1/local_db';     $update_free_access = FALSE;     $conf = array (       // Set production config options here...       'example_setting' =&gt; 0,       // Turn off most core caching.       'cache_inc' =&gt; 'includes/cache.inc',       'cache' =&gt; CACHE_DISABLED,     );     break;  } ?&gt;   This works pretty well for most purposes, but it means we have a lot of extraneous code sitting around in our shared settings.php file... is there a better way?
104449
How can I use varnish cache with nginx SSL termination for my SSL-Only (Https only) website? I use ubuntu 18.04 and I am currently running a wordpress site on my server.
41834
Has anybody used a good obfuscator for PHP? I've tried some but they don't work for very big projects. They can't handle variables that are included in one file and used in another, for instance.  Or do you have any other tricks for stopping the spread of your code?
123297
I have the following code  &lt;?php if ($handle = opendir('C:/xampp/htdocs/movies')) {     while (false !== ($file = readdir($handle))) {         if ($file != "." &amp;&amp; $file != "..") {             echo $file."&lt;br /&gt;\n";         }     }     closedir($handle); } ?&gt;   When it does have mb language such as japanese, it doesn't display properly instead it display like kyuukyoku Choujin R ?????~? rather then kyuukyoku Choujin R 究極超人あ～る  Anyway to make it display the correct name or make it still download-able by others?  Thanks for helping me :)