I am trying to setup a PHP server so that I could use the "Live" feature in Dreamweaver, in addition to being able to preview in my browser without having to upload the .php file via an FTP application every time, which is not efficient when I want to do quick small previews.
I have setup a new website and selected a folder for the site on my local drive.
For the server, I have the following information (I don't know how much of it is relevant):
Remote: Yes
Test: Yes
Server Name: Server
Connect using: FTP
FTP Address: my domain name
Username: my username
Password: my password
Port: 21
Root directory: blank
Use passive FTP: Yes
Use IPV6 Transfer Mode: No
Use proxy: No
Use FTP performance optimization: Yes
Maintain Synchronization Information: Yes
Automatically upload files to server on save: Yes
Enable file checkout: No
Server model: PHP MySQL
When I test the server, it is successful and I am able to get the site/server to show up in "Manage Sites". However, when I want to test my .php file on the "Live" preview panel or as a preview in Chrome, I get the error message: "Dynamically-related files could not be resolved because the site definition is not correct for this server." When I upload the .php file to my FTP manually, the page displays properly but when I try doing this it either does not work or the Chrome preview mode just spits out the entire raw code.
I tried and Googled, but I could not find a solution to this problem. Any help would be greatly appreciated.
Side note: I have my hosting from GoDaddy and the server from there is based on MySQL.
Thank you.
To set up PHP server with dreamweaver follow the following steps
Step 1.
Make Sure you have MAMA(For MAC OX) or WAMP (Window OS) install. If you dont know where to get then click this link
http://www.mamp.info/en/downloads/ and install in you system. (make sure if you are using skype close it because skype and mamp use same port. Later you can chage the port for Skype)
Step 2:
Open Dreamweaver and choose
Site > New Site
Step 3:
Type your site name and click on browse button to locate you htdocs folder (which is normally inside you mamp/wamp folder on you root directory).
Step 4:
Select Server from left hand side and click on add (+) sign.
Follow the following:
Server Name: localhost
Connect Using: Local/Network
Server Folder: (this is wehre your site located (i.e. inside htdocs folder)
Web URL: http://localhost/yourSiteName (yourSiteName is name of your folder)
Click Save.
Step 5:
Check Testing and click SAVE
Step 6:
Last but not least Open File Panel
Window > Files
Now create a new file and Save it inside you folder.
Thats it you are set mate.
hope thats helps
Cheers!
The problem is when you try and run your PHP file from your local machine, there's no web server running - nothing on your machine knows what to do with that file.
The solution is to run a local version of Apache, PHP, MySQL on your local machine - the easiest way to do is to download xaamp - http://www.apachefriends.org/en/xampp.html. Put your website files in the htdocs directory once it's installed, and you can view them by going to http://localhost/websitefoldername
Related
I am starting to work on a website for which I have not chosen a name or bought a domain. I enabled iis and installed php on my computer.
I want to create a temporary website just for testing my code, so I tried to add a website in the IIS Manager by right-clicking in the connections module and selecting "Add Website."
In this case I used "mywebsite.com" as a temporary name. The problem is that someone owns that domain and my browser takes me to their website instead of showing the local one. I tried changing the port from the default of 80 to 25, but I just then my browser says "page not found" when I try to view the webpage(right-click on site in IIS manager > Manage Website > Browse).
At this stage I just want to be able to see the output on my computer. Does anyone know I would do this?
In order to create a custom record that only resolves on your computer you can take the following approach:
Open notepad as an administrator
Open the file %WINDIR%\system32\drivers\etc\hosts
Add the line "127.0.0.1 mywebsite.com"
Ensure that your IIS site actually binds to mywebsite.com:80
Save the file and attempt to resolve the domain name in your browser
However, I highly recommend that you attempt to use a domain name that is not actually real. For instance dev.lauren.local, instead of mywebsite.com, that way you will reduce the likelihood of unexpected results :)
I have a Wordpress 4.5.4 website I downloaded from a remote server to my local development server installing both, the files and the database.
On the remote server is working "apparently OK" but on my local server is doing something strange because on lot of files is doing the following appending:
http://<domain>.com/wp-content/themes/mytemplate/style.css?ver=1.8.4
Notice the version at the end: 1.8.4 while the current version is: 4.5.4
(this situation happens with lot of files)
Then I checked on the server and for these files the version at the end is the right one: 4.5.4
Then on both, on the remote server and on the local development server I read the global variable: $wp_version and on both cases I got the right version: 4.5.4, so I don't know why the 1.8.4 at the end as default version for those files on my local development server?
On my local development server the website looks really different than on the remote server and the files I download as well as the database is the right one, because on the root of the remote directory I put a dummy file and I can read it via the browser using the url. Also, I tried changing the database password on the wp-config.php file on the server and I got database connection error, so the files I downloaded and the database are the right ones.
Any idea on how to solve this?
EDIT 1
Remote server: CentOS release 6.8 / PHP v5.3.24 / MySql v14.14
Local Dev server: Windows 7 / Wamp64 / PHP v7.0.0 / MySql v14.14
EDIT 2
On the local development server I modified the .htaccess file and the Windows' hosts file to use the same domain and avoid the necessity of these kind of changes (and be totally transparent for browsers). I do this with tons of websites, so for me is a normal procedure. Then my problem is not a localhost/domain.com conflict.
The version add in a wp_enqueue_script() or wp_enqueue_style() is an optional value, and is related to the script version.
This value could be add the developper for caching purpose but it is not always corresponding to the WordPress version. The example you show is only relative to the theme and it's certainly hardcoded by the developper (this could be great to show us the wp_enqueue_style() ).
If version is set to false, a version number is automatically added equal to current installed WordPress version. But, some script can check and enqueue different file (I think about for minify css that will not load when you are enqueuing file locally).
In case, verify that both server show the same
get_bloginfo('version');
If not, change your local value with phpmyAdmin.
Hope it gives you some hints.
You need to manually update the siteurl and home options in the _options table and replace your domain with something like http://localhost, and remember to add the port number if you are running it at a different port than the usual 80
If I write a php file on /var/www/html, the php file works well. For example a simple script in which I print phpinfo().
If I write a php script on my computer, then drag it to my server using Filezilla, it uploads well - to the extent that there are no error messages, and I am able to move the php script to /var/www/html.
However, when I try to access the file through my server's ip address (i.e. [server ip]/file.php - the page displays this error:
The 45.55.136.85 page isn’t working
45.55.136.85 is currently unable to handle this request. HTTP ERROR 500
For more information:
I write the php file in gedit encoded using Current Locale UTF-8 Line Ending Unix/Linux. And I have tried the three available transfer settings with no success Auto/Binary/ASCII on Filezilla
I upload files using FTP over TLS using Filezilla.
I have installed a LAMP stack.
This is a file permission problem, to solve this go to your Cpanel and under metrics section go into the errors
Most of the time you will find such error because of assigning extra permissions(write and execute) to the Group or World.
To solve this just withdraw the file permission and follow the below permission pattern.
Mode User Group World
Read check check check
Write check uncheck uncheck
Execute uncheck uncheck uncheck
What i have done:
I have installed acquia dev. I created new subdomain named abc
I could access the site url as http://abc.localhost:8082 in my local server.
I could see the folders within folder sites as
sites/all
sites/default
sites/abc.localhost
I have uploaded the files to my server and exported local database to import to live database.
My questions:
How to access abc.localhost site from the live server now and how to change configurations?
Anyone out there to help me in this. I could explain further for any comments. Thanks in advance.
Typically, your Drupal multi site structure should be as follow
sites/all
sites/default
sites/example.com
sites/sub.example.com
sites/example2.com etc...
the URL abc.localhost is a local URL only, so for the live server, you would need to change the directory title to your live server's domain name as seen above.
You could also do the following if you need to regularly update code between your live and local versions
sites/all
sites/default
sites/example.com -> abc.localhost // You can use a symlink here
sites/abc.localhost
Trying to get MAMP running with Dreamweaver.
When I preview a php file inside Dreamweavers 'Live View' mode instead of working direct from my file:
http://localhost/php_test/timetest.php
it creates its own temp file which looks like:
http:// 127.0.0.1/php_test/ TMPWY5ZEM.php
(I've added the additional spaces as stockoverflow assumed I was spamming)
I know the localhost runs correctly as if I type the URL directly into a browser it runs fine.
I've set up the Dreamweaver site correctly to the best of my knowledge, the details are below:
Local site folder:
/Applications/MAMP/htdocs/php_test
Server Folder:
/Applications/MAMP/htdocs/php_test
Web URL:
http://localhost/php_test/
Testing Server:
PHP MySQL
Any help?
This typically means that you have the preview using temporary file preference set (which I believe may be a default setting). Do the following:
Edit (Dreamweaver on Mac) Preferences, Preview in Browser category, uncheck Preview using temporary file
setup a testing server, if you have some problems from there, set your site type to localhost.