php.ini reset after restart WAMP
Posted by: omy (119.42.154.---)
Date: May 23, 2017 08:12AM

Hi, I am trying to call an API by cURL then I get an error

cURL Error #SSL certificate problem: unable to get local issuer certificate

to solve this issue I download a file and put in the ssl directory here is the path for the directory

C:\wamp\bin\php\php5.6.25\extras\ssl\cacert.pem

now click over to WAMP icon then select php and click on "php.ini" then it opened in my text editor, here i make changes to
openssl.cafile , here i give path of cacert.pem file

openssl.cafile="C:\wamp\bin\php\php5.6.25\extras\ssl\cacert.pem"

and remove ; before this line.
Now restart all service from WAMP menu(here i restart only services not WAMP) after that everything is fine and its working

When i exit WAMP server then i got the same error
cURL Error #SSL certificate problem: unable to get local issuer certificate

now I again open php.ini then i see the changes that i made there are discarted and php.ini file is look without any changes

Options: ReplyQuote
Re: php.ini reset after restart WAMP
Posted by: kashiffkhann (103.76.101.---)
Date: June 03, 2017 12:52PM

I am trying to connect my database using php scriptstoring it in a public directory of WAMP server (i.e,WWW folder) but as i browe it shows the complete php script in the browser instead of showing the result of the script.please guide it would be a great favour .

MY PHP script is

<?php

$db_name="webappdb";
$mysql_user="root";
$mysql_pass="";
$server_name="localhost";

$con=mysqli_connect($server_name,$mysql_user,$mysql_pass,$db_name);
if(!$con)
{
echo"Database Connection Error...".mysdqli_connect_error();
}
else
{
echo"<h3>Database Connection Success....</h3>";
}



?>

Options: ReplyQuote
Re: php.ini reset after restart WAMP
Posted by: RiggsFolly (Moderator)
Date: June 04, 2017 04:21PM

Hi,

What is the file name of this script? For a PHP script to run the filename must have an extension of `.php`

Are you running the script from the address bar of your browser? PHP Scripts wont run if you doubleclick them from Explorer. If the url in the browser starts with `file:///` then you are launching the script incorrectly via Explorer.

---------------------------------------------------------------------------------------------
(Windows 7 Pro 32bit) (Wampserver 3.0.6 32bit)
<Apache 2.4.23/2.2.31> <PHP 7.1.2/7.0.16/5.6.28/5.5.38/5.4.45/5.3.29> <MySQL 5.7.10/5.6.17/5.5.28>
<MariaDB 10.1.21> <phpMyAdmin4.6.5.2> <MySQL Workbench 6.3.6.511>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin -- WAMPServer alternate Repo
-?-?-?- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -?-?-?-

Options: ReplyQuote
Re: php.ini reset after restart WAMP
Posted by: kashiffkhann (103.76.101.---)
Date: June 05, 2017 08:48AM

The file name of this script is init.php and i am using chrome as my default browser yes i am launching the script from the address bar of the browser the file is stored exactly inside the www directory

HERE IS THE SCRIPT

$db_name="webappdb";

$mysql_user="root";

$mysql_pass="";

$server_name="localhost";

$con = mysqli_connect($server_name,$mysql_user,$mysql_pass,$db_name);

if(!$con)
{
echo "Database Connection Error...".mysdqli_connect_error();
}
else
{
echo"<h3>Database Connection Success....</h3>";
}
?>


Please guide me if you can, i am stuck from last 10 days have done lots of RND on stackoverflow but didnt found anything helpful...

Options: ReplyQuote
Re: php.ini reset after restart WAMP
Posted by: RiggsFolly (Moderator)
Date: June 05, 2017 10:08AM

Hi,

Do you have a start PHP tag `<?php` at the beginning of that script

<?php
    $db_name="webappdb";
    $mysql_user="root";
    $mysql_pass="";
    $server_name="localhost";

    $con = mysqli_connect($server_name,$mysql_user,$mysql_pass,$db_name);
    if(!$con) {
        echo "Database Connection Error...".mysdqli_connect_error();
    } else {
        echo"<h3>Database Connection Success....</h3>";
    }
?>

---------------------------------------------------------------------------------------------
(Windows 7 Pro 32bit) (Wampserver 3.0.6 32bit)
<Apache 2.4.23/2.2.31> <PHP 7.1.2/7.0.16/5.6.28/5.5.38/5.4.45/5.3.29> <MySQL 5.7.10/5.6.17/5.5.28>
<MariaDB 10.1.21> <phpMyAdmin4.6.5.2> <MySQL Workbench 6.3.6.511>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin -- WAMPServer alternate Repo
-?-?-?- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -?-?-?-

Options: ReplyQuote


Sorry, only registered users may post in this forum.