-
Notifications
You must be signed in to change notification settings - Fork 40
XAMPP Users
During the installation process of XAMPP you will be presented with various dialogue boxes. One such dialogue states that the timezone values in both php.ini and my.ini have been set to “America/Chicago” and that you should change them if they are not correct. The problem is you’re not told where you can easily find those files.
Before you do anything you’ll need the timezone information applicable to you. Head over to http://us2.php.net/manual/en/timezones.php where you will find a list of supported timezones divided by various geographic regions. I chose “America”. Then, you will be presented with a list of timezones under the heading “America”. I chose “America/Winnipeg” – select the one applicable to you and make note of it's name.
Navigate to C:\xampp\php\php.ini and open the file in a plain text editor such as Notepad. Look for the following …
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "America/Chicago"
Change “America/Chicago” to the proper value. In my case it is “America/Winnipeg”. Save the file and restart Apache (if it is running) in order for the change to take effect.
Next, navigate to C:\xampp\mysql\bin\my.ini and open the file in a plain text editor such as Notepad. Look for the following …
default-time-zone = "America/Chicago"
Again change the value to the one applicable to you. Save the file and restart MySQL (if it is running) in order for the change to take effect.
###PHP CURL HTTPS causing exception SSL certificate problem
You need just to set cacert.pem to curl.cainfo.
- download http://curl.haxx.se/ca/cacert.pem and save it somewhere.
- update your php.ini file by adding the following line:
curl.cainfo = "C:\path\to\cacert.pem"
- Open C:/xampp/apache/conf/httpd.conf
- Look for 'mod_rewrite' If status is as a comment with #, make it a command line removing the # in the beginning.
- By default, XAMPP for windows does not allow .htaccess files to override httpd.conf file so look for:
AllowOverride none
and replace as
AllowOverride All
To create a new user/pass:
Find xampp/apache/bin/ directory. On my machine that is at C:\xampp\apache\bin\htpasswd.exe.
This program will create a user and a password in a specified file (normally .htpasswd). You should open a command prompt and call the following command to create the password file for the first time. (to add new users, simply omit the -c )
htpasswd.exe -c -b .htpasswd username password
This will create a new password file called .htpasswd with the username frank and the password password. (the -b command basically tells it to take the password from the command line, if you omit the -b and the password, then the program will ask you to type the password in twice to confirm). Shown below:
C:\xampp\apache\bin>C:\xampp\apache\bin\htpasswd.exe -c C:\xampp\examplepasswords\.htpasswd username
Automatically using MD5 format.
New password: *******
Re-type new password: *******
Adding password for user username
Simply put the following information into a file called .htaccess, and put the file into the directory to protect.
AuthName "Protected Area"
AuthType Basic
AuthUserFile C:/xampp/secret/hidden/place/.htpasswd
require valid-user
To create an .htaccess file in windows, save the file as .htaccess.