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
Related
My local installation of a Typo3 Page worked perfectly fine on a Xampp Server but when I tried moving it to my webserver I get the error
The Fluid template files [Path to my layout.html] could not be loaded.
More information regarding this error might be available online.
I transferred the files from Htdocs with FTP and the database with phpmyadmin import/export.
What could cause this error?
In this generality there are multiple reasons possible:
Can the apache user access the files? (the FTP user mostly is different than the apache user and the correct file- und folder-permissions can be lost easily)
Have you the same filenames and pathes?
don't use the windows folder separator \ on unix-servers.
is your local file systems case insensitive? Linux is case sensitive and /test/is another folder than /Test/.
Did you set your correct domain record on the pagge tree root?
If not please set the domain record to the actual url you try to reach the page.
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
I'm trying to use Dreamweaver with an existing code base (not WP, Drupal, or Joomla!) in a PHP/MySQL site. I continue to receive "Dynamically related files could not be found because of an internal server error." I've been googling all day and have read plenty of WP-specific solutions, including the thread on this site. I've tried all the methods listed, no luck.
Setup Info
MAMP 2.0.1
Mac OS X 10.6.8
Dreamweaver CS 5.5
Site's local address: /Users/myName/Sites/siteName
Testing server address: /Applications/MAMP/htdocs/siteName
Attempted solutions:
1) added library to site root (/Users/myName/Sites/siteName/library)
2) added library to MAMP root (/Applications/MAMP/library)
3) added include path for both locations to applied php.ini listed in phpinfo
4) set Dreamweaver to use Site Root paths instead of page-relative paths
5) switched back to page relative paths
6) Restart MAMP, reset ports in Preferences to 8888/8889, or 80/3306
7) checked site info to make sure paths are correctly defined
When I insert the following code, or any require function with a relative path, live view and preview in browser display empty pages.
<?php require_once('includes/initialize.php'); ?>
I'm incredibly frustrated. I had been using XAMPP and a plain text editor for previous work and never had an issue with relative paths. Any help would be appreciated.
Answering my own question; bad form, I'm aware.
EDIT:
Adding to previous list of attempted solutions:
8) tried designating the server ports as 8888/8889 and defining server route as http://localhost:8889/mySite/, like setting up a Drupal/WP/Joomla! testing environment.
9) Uninstalled/Reinstalled MAMP, Dreamweaver, disabled the out-of-the-box Apache server included with OS X, the redefined the site in Dreamweaver.
Fix attempt 8 led to packet error discussed here. Fix attempt 9, plus error reporting that hadn't been working, but did now:
// Report all PHP errors (see changelog)
error_reporting(E_ALL);
showed that the testing server was using the local definition to refer to dynamically related files and, even though that should work, it wasn't working.
After reinstall, created new site with "Site > Manage Sites" and defined Local Site Folder in "Site" menu and the Server Folder in the "Server" Menu as the same directory. (/Applications/MAMP/htdocs/mySite)
Refer to the Setup info in the OP to see my system variables; this may be specific to any/all settings. But only identical local definition and server definition solved the problem. I've recreated previous settings to be sure, and different local/server definitions don't work.
This error can happen with Dreamweaver and PHP sites if the contents of the included file make additional dynamic calls using PHP syntax that Dreamweaver doesn't recognize. Without seeing the contents of initialize.php, I can't be 100% sure this is the case but I am pretty sure that DW is not able to parse the code there and figure out what files to get for display.
Problem Dynamically related files that I see a lot of people run into:
Dreamweaver is scanning whatever is in you Local Copy, it should be a the full installation of WordPress. If you're working locally, download everything on your "Testing server" to your "Local view" in the Files panel.
If you're working with two sets of files, your local copy and what is in MAMP's htdocs or on your "Testing server" should be nearly identical, except for what you're working on of coarse. That's the problem I see people have.
If you're working in kind of "pho-FTP" environment.
I have used get_meta_tags("squidoo.com") to get keywords and description. When I run in my PC with WAMP Server 2.1 (PHP 5.3) it working perfectly but when i upload to linux server PHP 5.2 It is not work for squidoo.com .
I test with
$datas = get_meta_tags("http://squidoo.com")
$keywrds = $datas['keywords'];
$desc = $datas['description'];
When I run in my PC it work perfectly but there is blank data in $keywrds and $desc when i upload to server.
Above code work with almost sites, I got error with www.squidoo.com and some others only
you haven't given us much info on the errors you're getting, but the most likely reason for this to fail is that your local server is configured to allow commands which open a file to use a URL, whereas your Linux server isn't.
This is a PHP.ini configuration setting, which specifies whether you can use URLs as file names. If it is switched off then PHP won't allow you to open files from a remote site and will only allow it from files on its local server.
Switching it off is considered good security practice, so most PHP hosting providers will turn it off by default. You may be able to turn it on youself, depending on your provider, or you may just have to work around it by downloading the URL using CURL and then examining the downloaded file.
See the PHP manual entry for this config setting here: http://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen
That might be because you have local file called squidoo.com on your WAMP setup. If you want it to work on the actual website, then you have to provide an URL:
print_r(
get_meta_tags("http://squidoo.com")
);
Notice the http:// which differentiates web addresses from files.
My purpose is to setup a forum in php just locally on my Windows 7 machine to test how it works.
I have installed Apache HTTP Server and PHP v5 successfully. Then I downloaded and extracted the phpbb-forum software and put it in my root folder. Then I realized that I needed some kind of database so I downloaded and installed MySQL. To configure my database I also downloaded and extracted phpMyAdmin but I can't get it to work. When I open my browser and navigate to my phpMyAdmin-folder I simply get this:
Screenshot: http://img836.imageshack.us/img836/5139/captureqb.png
I use my Apache server to preview my website where I'm using some php include functions so I know that I've a "working" PHP installation. The MySQL service is also running on my computer.
However, do you need to configure PHP and/or Apache in order to get phpMyAdmin to work properly? I'm a complete noob on this so I suppose it may be multiple shortcomings.
Thank you.. //Realiserad
The simpler way is to install WAMP server : it bundle Apache, PHP, MySQL and PHPMyAdmin preconficurated for work together.
You need to enable the MySQL extension to use MySQL from PHP.
The MySQL extension may or may not be bundled with your PHP distribution. (look for php_mysql.dll in the ext folder)
Assuming it's installed you can enable it by adding or uncommenting this line in your php.ini:
extension=php_mysql.dll
As other people have said it may be simpler to install WAMP Server
Have a look at: http://www.ricocheting.com/how-to-install-on-windows/mysql - Specifically, the 3rd step. It involves downloading the mySQL PHP Extention (which is a dll), and un-commenting a line of php.ini so that PHP Load's the extension.
While is may be simpler to install XAMPP or WAMP, I think that it's good to know how to fix your own problems - Scientia potentia est :D
not very familiar with windows, but it seems like you miss the php-mysql extension, which you can download from here (i think):
http://mysql2.mirrors-r-us.net/downloads/connector/php/index.html
would be alot easier for you to use a preconfigured wamp install like this one (available for win/mac/etc). google "xampp", i'm not allowed to post more than one link due to stackoverflows spam protection.
Configure PHP to Access MySQL
Open the c:\php\php.ini file with your favorite text editor.
Uncomment the following lines by removing the semicolon:
extension=php_mysqli.dll
extension=php_mbstring.dll
extension=php_mcrypt.dll
save and exit editor
After extracting the archive into phpmyadmin folder, you will have to configure phpmyadmin before you can connect to sql server.
you should create a configuration file. This file can be created manually (simply use a text editor),
During your first session you will see an error message.
To solve this problem you should create folder (C:\project\wwwroot\phpmyadmin\config). After that give full rights for IIS_IUSRS group and IUSR user.granting permission/image
Return to the config window. Visit localhost/phpmyadmin/setup/
To configure the connection settings click on the “New Server” button.
Enter the verbose name of the SQL server, and then the server hostname. If necessary, you can specify other settings.[setting up/image][2]
Save the settings and then the server will redirect us to the previous page. Choose:
the default language – English
the default server – 127.0.0.1
end of the line – Windows (\ r \ n)
Click Save, and then download. The received file (config.inc.php) you should save to the root directory (C:\project\wwwroot\phpmyadmin).
Open the authorization window (//localhost/phpmyadmin/) and login under root account. If you see a starting phpMyAdmin window, you can delete config folder.
For the correct work phpMyAdmin requires a database with the information. The script for creating database is already installed.