snipt

Ctrl+h for KB shortcuts
#116541

Text only

PHP show errors

ini_set('error_reporting', E_ALL);
https://snipt.net/embed/02e786ea58bc9677b2518c6307f58945/
https://snipt.net/raw/02e786ea58bc9677b2518c6307f58945/
02e786ea58bc9677b2518c6307f58945
text
Text only
1
2014-04-13T08:42:48
True
False
Feb 25, 2014 at 04:34 AM
/api/public/snipt/116541/
php-show-errors
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>ini_set(&#39;error_reporting&#39;, E_ALL); </span></pre></div> </td></tr></table>
apache, php
#63640

Text only

Wamp won't Start (Apache won't start)

1
2
3
4
5
If it's an error in your httpd.conf go to your apache bin folder (for instance C:\wamp\bin\apache\apache2.2.22\bin) and run httpd.exe in command line.

It should tell you if and where is the error (which line).

For any other problem, take a look at this great post: http://smallcitydesign.com/wamp-wont-start/
https://snipt.net/embed/9c7710f5f270d1df512c150c97dc891e/
https://snipt.net/raw/9c7710f5f270d1df512c150c97dc891e/
9c7710f5f270d1df512c150c97dc891e
text
Text only
5
2014-04-16T13:16:02
True
True
Jun 09, 2013 at 09:03 AM
/api/public/snipt/63640/
wamp-wont-start-apache-wont-start
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>If it&#39;s an error in your httpd.conf go to your apache bin folder (for instance C:\wamp\bin\apache\apache2.2.22\bin) and run httpd.exe in command line. </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>It should tell you if and where is the error (which line). </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a>For any other problem, take a look at this great post: http://smallcitydesign.com/wamp-wont-start/ </span></pre></div> </td></tr></table>
apache, httpd.conf, start, wamp
#52977

Text only

.htaccess directory password protection

1
2
3
4
AuthName "Access restricted."
AuthType Basic
AuthUserFile /home/www/.htpasswds
Require valid-user
https://snipt.net/embed/013938d62052a205ec53320f3311c016/
https://snipt.net/raw/013938d62052a205ec53320f3311c016/
013938d62052a205ec53320f3311c016
text
Text only
4
2014-04-16T11:55:40
True
False
Jan 08, 2013 at 05:15 PM
/api/public/snipt/52977/
htaccess-directory-password-protection
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>AuthName &quot;Access restricted.&quot; </span><span id="L-2"><a name="L-2"></a>AuthType Basic </span><span id="L-3"><a name="L-3"></a>AuthUserFile /home/www/.htpasswds </span><span id="L-4"><a name="L-4"></a>Require valid-user </span></pre></div> </td></tr></table>
.httaccess, apache
#52883

Text only

Ejecutar un PHP en vez de un JS

1
2
3
4
5
RewriteEngine on

RewriteCond %{REQUEST_URI} ^/magic.js
RewriteCond %{QUERY_STRING} ((.*))?
RewriteRule (.*)  magic.php?%2 [L]
https://snipt.net/embed/47146a4e3fbda964500551cfd323c087/
https://snipt.net/raw/47146a4e3fbda964500551cfd323c087/
47146a4e3fbda964500551cfd323c087
text
Text only
5
2014-04-15T13:32:36
True
False
/api/public/snipt/52883/
ejecutar-un-php-en-vez-de-un-js
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>RewriteEngine on </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>RewriteCond %{REQUEST_URI} ^/magic.js </span><span id="L-4"><a name="L-4"></a>RewriteCond %{QUERY_STRING} ((.*))? </span><span id="L-5"><a name="L-5"></a>RewriteRule (.*) magic.php?%2 [L] </span></pre></div> </td></tr></table>
apache, htaccess, js, php, vhost