Copy link to clipboard
Copied
I have been using Dreamweaver for the past 7 years CS5 on a Mac and just recently updated to Adobe Cloud and my entire site broke. I am currently using localhost because I don't even dare wanna see what it does to a live site if it's breaking local host at the moment. I use MAMP for this localhost process. It's come to my attention that server behaviors and stuff like that have been removed here because they "recommend" you use something else or some other way. Pages show up completely fine until it's asking for any information from my localhost MYSQL sever. No coding has changed at all, yet once I remove all of the recordset code (which yes was used from the server behavior tabs and stuff but I know how to write myself) the page shows completely fine yet now I have a broken page. I'm unsure if I'm just overlooking something completely obvious or if I'm pretty much at the point to find a new program to use or a new way to do it. Thing is, I don't know WHAT I should even do next. My live site (which hasn't touched adobe cloud at all yet) still runs completely fine, so I'm unsure what the problem completely is, but would love some feedback or even someone I can put my head together with to figure this out because I've gone 2 days completely stumped.
Copy link to clipboard
Copied
Moved it from Creative Suites to Dreamweaver support forum.
Copy link to clipboard
Copied
The Server Behaviours panel has been left out of all Dreamweaver CC products because it produced outdated code, namely, code that was not PHP7 compliant.
If you are still using an outdated PHP version and you want to resurrect your development environment then (I'll make it brief) follow these steps.
Note: There is no need to uninstall CC2017.* because the two versions will sit nicely on your system, albeit not run concurrently.
Copy link to clipboard
Copied
I'm not sure what you mean by 'broken your site'. Code is code - a program wont break it, unless you do something which results in it breaking. You won't be able to use DWCC 2017 (out-of-the-box) going forward for dynamic mysql/php development, unless you can write your own code, as the outdated server behaviours have been removed.
However you should be able to edit the rest of your code in DWCC 2017 and then view the page/s by typing its address into a broswers url field:
localhost/name_of_your_site_folder/name_of_your_file.php
Obviously this is no help if you want to add additonal dynamic mysql and php functions to the site like getting results from your database BUT DW 2017 has not broken your site, its just not going to be of any help to you, as it was in past versions, if you want to create database driven sites.
As Ben has suggested you either need to drop back to DW CC2015 or if you dont want your site to break in future you need to convert your outdated msql code to the new improved mysqli code or PDO.
Copy link to clipboard
Copied
When I was saying break I meant that any page which connected to my database just showed a white screen instead of any content from my site. You you're saying to convert my mysql to mysqli, but would I also have to do something with the PHP since its apparently not compliant?
Copy link to clipboard
Copied
Did you define your local testing server in DW? And is your local site folder in the testing server's default web directory? On MAMP, the default is htdocs.
The latest versions of MAMP default to PHP 7. Unfortunately, the deprecated server-behaviors generate code that does not work with PHP 7 or higher. So you will need to revert your server's PHP version back to 5x. Or replace your old server-behavior code with modern PDO or MySQLi.
Nancy
Copy link to clipboard
Copied
I have set everything up correctly and did try to revert my default MAMP preferences back to PHP version 5 but was still getting the blank screen, personally what would you suggest to use more, MySQLi or PDO?
Copy link to clipboard
Copied
When I roll back to PHP version 5.6.30 I get a "Access denied for user ''@'localhost' (using password: NO)" error
Copy link to clipboard
Copied
That means your permissions are incorrect.to access that database. You would need to reset them in phpMyAdmin.
Why did you change the php version from 5.6 to 7? mysql which the DW server behaviours use is not compatible with php 7.
PDO is a more transportable method for connecting to different databases if you intend to use something other than mysql in the future, if not go with mysqli . The i stands for improved.
Copy link to clipboard
Copied
When I re downloaded MAMP it default changed to that version of PHP, which when loading gives a full blank page, when loading with anything 5 it gives me an error yet this is the connection I have
<?php
$user = 'root';
$password = 'root';
$db = 'RopinRanch';
$host = 'localhost';
$port = 8889;
$link = mysqli_init();
$success = mysqli_real_connect(
$link,
$host,
$user,
$password,
$db,
$port
);
?>
Which I know cannot be wrong. Unless this is written in the wrong PHP version.
Copy link to clipboard
Copied
Humm now lm confused because the code you are showing has not been generated by any DW server behaviour, so where did that come from?
Copy link to clipboard
Copied
That came from my MAMP start up page. It's what MAMP said to use, it's not what I originally used. This is what I originally had:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_RopinRanch = "localhost";
$database_RopinRanch = "RopinRanch";
$username_RopinRanch = "root";
$password_RopinRanch = "root";
$RopinRanch = mysql_pconnect($hostname_RopinRanch, $username_RopinRanch, $password_RopinRanch) or trigger_error(mysql_error(),E_USER_ERROR);
?>
Copy link to clipboard
Copied
This is what my MAMP startup page says to use for PHP versions greater than 5.6
Copy link to clipboard
Copied
The connection code you are showing is for mysqli and will not work with dw server behaviours.
Drop back to version lower than 5.5, and use the db connection script for mysql.
Copy link to clipboard
Copied
Even when dropping back and using this code
$user = 'root';
$password = 'root';
$db = 'inventory';
$host = 'localhost';
$port = 8889;
$link = mysql_connect(
"$host:$port",
$user,
$password
);
$db_selected = mysql_select_db(
$db,
$link
);
which is what MAMP start up page says to use for PHP <5.6 I am receiving a blank page with no content
Copy link to clipboard
Copied
Just a though, but when you redownloaded and installed mamp, you did check that the database was still there, and not empty?
Copy link to clipboard
Copied
You cannot use the code that MAMP suggests. DW wrote its own rubbish that is not compatible with anything other than what it wrote unless you know how to tweak it around.
You should be able to connect usingb the original DW code but you have somehow messed things up by updating Mamp.
Now might be an idea to jump on youtube and review some tutorials of how to connect using mysqli as sooner or later you will need to do that especially if your remote server suddenly says they sre upgrading their servers to php 7
Copy link to clipboard
Copied
Just a thought to add to your reply Os, but if i remember correctly Dw only supplied a link to the connection script as the first item in the php section above the html code, then refered to that script for each query.
If the OP has replaced the link code in the page, the query's would have no valid reference to the connection, or?
Copy link to clipboard
Copied
pziecina wrote
Just a thought to add to your reply Os, but if i remember correctly Dw only supplied a link to the connection script as the first item in the php section above the html code, then refered to that script for each query.
If the OP has replaced the link code in the page, the query's would have no valid reference to the connection, or?
Correct thats why its no good using any other connection code than what DW wrote if you want it to reference the rest of the mysql code which DW wrote
Copy link to clipboard
Copied
I would not be worrying about your connection code. The database connection code that the DW server behaviours wrote will still work if you choose a lower version of php in Mamp, if its available.
You only need to concern yourself with different code if you intend to completely rewrite all the DW server behavoiur code, mixing it wont work.
Copy link to clipboard
Copied
To test the connection to your local server's database, copy & paste this code into a new, blank PHP file and saveAs test-connect.php. This will also confirm which PHP version MAMP is using.
<?php
$con = mysqli_connect("localhost","username","password","database");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
else echo "Successfully connected, happy coding!"
?>
<?php phpinfo() ?>
Copy link to clipboard
Copied
Okay so it says successfully connected, and that my PHP version is 5.4.45 but I would like to work on highest version of PHP - but lets work from the problem as if 5.4.45
My website might connect, but still I'm getting a blank page , what would you suggest I try to do to fix it
Copy link to clipboard
Copied
Which PHP version does your remote server have? That's the highest version you can use locally.
Blank pages could be caused by any number of things....
Copy link to clipboard
Copied
I separate my testing and my remote to two different servers. My live server that is running fine is PHP 5.6. When I changed my MAMP to 5.6.30 and still get a blank page. let me see if I can explain my issue more.
I have a front page - It has mostly HTML and CSS but has a log in feature on it. This page shows up completely fine. When I add in credentials and connect, the page then refreshes (doesn't even go to the redirect page so it never logged in) and gives a fully blank white page. (the URL still says index.php)
My front page also has a PHP script which pretty much says "If user is logged in when on this page move to inside of the site" and even after using my log in a bunch of times, it always loads the index page which means that MM_Username is never valid.
So then is this my mysql issue?
Copy link to clipboard
Copied
Does MAMP server have a database for usernames and password? Are the tables populated with data?
You can check that with phpMyAdmin.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now