Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use PHP with SSL

Tags:

php

ssl

My server provides SSL connections via https, although the certificate costs extra...

Is there anything that needs to be changed in the PHP code to utilize this protocol?

My site has:

  • ajax forms via POST
  • regular forms and pages using POST and GET parameters
  • Session variables
like image 408
allanx2000 Avatar asked Feb 04 '13 20:02

allanx2000


1 Answers

You should be good to go. PHP does not impact the use of SSL or not.

Things you should check are:

  • Are all URLS in you application relative (no http://)
  • Are assets (CSS/JS/IMG) used in your site (both from internal and external sources) also as relative paths or prefixed with https://

Having an asset without https:// in a SSL powered site, the browsers will warn you visitors that something ain't right.

like image 81
mvbrakel Avatar answered Oct 20 '22 18:10

mvbrakel