Posts Tagged ‘apache’

WAMP curl not working in local pc

Posted: July 16, 2014 in PHP
Tags: , ,

1) Enable curl extension in both php.ini ( file location shown below)

extension=php_curl.dll

D:\wamp\bin\php\php5.3.13\php.ini

D:\wamp\bin\apache\apache2.2.22\bin\php.ini

2) Download php_curl.dll from below link and replace it in D:\wamp\bin\php\php5.3.13\ext.

If your PHP version is 5.3.14 then download “php_curl-5.3.14-VC9-x64.zip” fromĀ http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/ underĀ  ‘Fixed curl extensions‘ .

 

Advertisements

If you are using wamp and enabled openssl from icon tray and still you are getting this error then:

When you enable php_openssl through the WAMP UI, you enable it for Apache, not for the CLI

You need to modify C:\wamp\bin\php\php-5.4.3\php.ini.

For testing purpose add host entry in windows.

Open C:\Windows\System32\drivers\etc\hosts fiel and add below code at bottom of file.

127.0.0.1 myprofile.com
127.0.0.1 john.myprofile.com
127.0.0.1 lisa.myprofile.com
127.0.0.1 mathew.myprofile.com

 

Add below code in apache httpd.conf file.

DocumentRoot "d:/wamp/www/"
<VirtualHost 127.0.0.1>
ServerName www.myprofile.com
DocumentRoot d:/wamp/www/inhouse-demo/myprofile/
</VirtualHost>

 

Once all done restart wamp & clear browser cache.

Now when you open http://myprofile.com it will redirect to your project home page.

Same way with http://john.myprofile.com and http://mathew.myprofile.com.

Now you can add below php code on top of your php file.

$domain = $_SERVER['HTTP_HOST'];
$subdomain = substr($domain, 0, strpos($domain, '.'));

Now use subdomain variable and check in database for user dependent data.

 

 

Enable htaccess in apache

Posted: July 5, 2012 in PHP
Tags: , ,

Wamp Tray > Apache > httpd.conf :edit this file:
Find for below line:
;LoadModule rewrite_module modules/mod_rewrite.so

And change it to:

LoadModule rewrite_module modules/mod_rewrite.so