I am working on a downloaded version of an application and am getting multiple errors due to:
( ! ) Warning: include(/home/USERNAME/public_html/dir/includes/functions.php): failed to open stream: No such file or directory in C:\wamp\www\dir\includes\db_connection.php on line 6
I understand what the error is but I don't want to have to manually change all these includes in the code mainly as doing so means when I update my ive site they will then be wrong.
Is there a way using either WAMP or Windows of creating something like a symlink to tell WAMP that anything in /home/USERNAME/public_html/dir should be served from C:\wamp\www\dir?
I found an option in WAMP for creating an alias but I am not sure if this is the right thing to use?
There is an answer on SO here.
This link https://www.sevenforums.com/tutorials/278262-mklink-create-use-links-windows.html would serve well too (from the answer above).
Basically you have to use mklink Windows command from command prompt (the latter must be run as administrator).
Now. Assume you have WAMP installed and virtual host named mysite.local is created and pointinig to the physical d:\mysite folder. You want now the files in the folder f:\otherfolder\realfolder to be accessible via mysite.local/otherfolder/somefile.ext kind of URL.
For this you have to create the symbolic link named otherfolder in d:\mysite that will point to f:\otherfolder\realfolder. You have to execute:
mklink /D d:\myfolder\otherfolder f:\otherfolder\realfolder
from Windows command prompt. The link otherfolder is created in d:\myfolder and you can access files via an URL as mentioned above.
Related
currently im trying to make backup and restore mysql database in my laravel project. I am using this laravel package https://github.com/backup-manager/laravel for backup package. i already follow the intructions, but when i am trying to backup my local database through command line (php artisan db:backup) in the last question, i got this message.
Dumping database and uploading...
[BackupManager\ShellProcessing\ShellProcessFailed]
'mysqldump' is not recognized as an internal or external command,
operable program or batch file.
I already googling it, and already put C:\xampp\mysql\bin to my windows env variables paths, but i still having this issue. if anybody know how to fix this, please tell me, i really appreciate it.
Laravel 5.1.x
It is because mysqldump.exe is not found in that location, the right path is given bellow
Open Command Prompt and type this
cd C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin
Press Enter
then type
mysqldump.exe
or,
Directly open this directory "C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin" and Press LEFT SHIFT KEY from keyboard and RIGHT CLICK on the Directory Window.
then type
mysqldump.exe
It will work 100% correctly
If you are using Xamp then:
Open your Xamp folder
Go to \mysql\bin find the mysqldump.exe
Go to your environment variables under System variable click on 'New'.
As 'variable name' put 'mysqldump'(without the quotes) and as 'variable value' put the path to your xamp\mysql\bin\mysqldump.exe this will make 'mysqldump' available as a global system alias.
Reminder: Make sure to restart your command-line interface.
It happened with me and I solved it by adding the following line at the top of the .bat file.
cd "C:\xampp\mysql\bin"
Please add C:\xampp\mysql\bin to this path at your user variables and system variables. If you are using a wamp server, add C:\wamp64\bin\mysql\mysql8.0.27\bin this path at your user and system variables.
Note: MySQL version path will change as per your installation.
On my side, I was using PowerShell and I had the same error message.
I had to go inside the directory of MySql. Mine was located in:
C:\Program Files\MySQL\MySQL Server 5.7\bin
Then I had to make sure that I had mysqldump.exe in the bin folder.
And then run this command:
./mysqldump.exe -u root -p yordbName > C:\MySqlDump\sakila.sql
It is late, but I will answer to this question for other people who have the same issue.
You need to add the mysqldump.exe runtime file path to your Windows environment variable. I am using Wamp, the path look like this "C:\wamp64\bin\mysql\mysqlx.x.xx\bin"
Close your command-line interface and try again, It should work.
I am using Xamp and the following step is working:
Copy the path "C:\xampp\mysql\bin"
Go to your environment variables under System variable click on 'Path' and add "New".
Put the path there then click ok.
Restart your command-line interface.
I primarily use Mac OSX for programming and then test it in windows periodically. I just installed XAMPP on a Windows 7 computer and I'm getting the following errors
Warning: _cake_core_cache was unable to write 'cake_dev_en-us' to File cache in C:\Program Files\xampp\htdocs\testproj\lib\Cake\Cache\Cache.php
Warning: C:\Program Files\xampp\htdocs\testproj\lib\Cake\Cache\persistent is not writable in C:\Program Files\xampp\htdocs\testproj\lib\Cake\Cache\Engine\FileEngine.php
I opened up the testproj folder properties and unchecked Read Only and applied it to all folders/subfolders. I tried to open the Cake application again and the same error message was displaying so I checked the folder properties again and it had a square in the Read-Only box, not a check mark. Does that signify anything? I'm not sure what exactly the square means instead of a check mark.
I am signed into the administrator account on this computer. Is there some kind of command similar to chmod -R 777 for windows?
Thanks
Update - I changed the installation from Program Files to C:\xampp... and I still get the errors. I then created a partition and installed xampp to G:\xampp... and the error still exists
Using C:\ and especially the Program Files folder is a really bad idea for developing with PHP on Windows. Use another partition or at least a folder outside of system internal folders.
There is a reason WAMP and most tools by default try to install themselves in C:\wamp\ etc.
Edit: also try to avoid folder names with spaces in them like the windows-stupid "Program Files" default folder. And mind your casing, even if that is not directly visible in Windows, it will otherwise kill your app when going live with it on a unix server.
Where can I write the following command
i am following the developer tutorial for simple hello world script here
google_appengine/dev_appserver.py --php_executable_path=pathto-php-cgi path-to-your-app
When I run application in google app launcher I get a error message . I have WAMP install and it is running fine.
The path specified with the --php_exectuable_path flag () does not exist.
Php path - c:\php\php-cgi.exe
I also met this problem, and it has been solved.
for example,
if your PHP folder is E:/sam/php/
if your PHP site folder is F:/mysite/facebook/
if your dev_appserver.py is under E:/whatever/
I'm not sure how to change googleapplauncher.exe configurations, instead, you have to use cmd instead. I think this exe has config files but I did not find it. Open the command window and go to folder E:/whatever/ to run "python" command under this folder.
Type in:
python dev_appserver.py --php_executable_path=E:/sam/php/php-cgi.exe F:/mysite/facebook/
NOTE: REMEMBER to type "php-cgi.exe"
use slash
I dont know which is the name of the file in Windows, but i just have that problem, the full path from / for your php-cgi54.exe including the fullname of the file and then the full path from / of your folder.
I also run it like admin so check if your cmd or terminal was open with admin rights.
#Chander if you have wamp running you need to select a different listening port for app engine by typing the command: --port=9999 for example.
Here's what worked for me:
Open your cmd, make sure you're in the same directory as your sdk.
Type: "google_appengine/dev_appserver.py" --port=9999 --php_executable_path="fullpath\php-cgi.exe" "helloworld/"
If you have another local server like xampp or wamp,make sure you use the --port command to select another listening port as shown above.
Press enter and you should have your helloworld script working.
Specifically, I'm trying to get ViewGit working on a PHP/Apache/Windows installation.
It seems that PHP is unable to run exec('git');.
exec('whoami'); works just fine, so it isn't a problem with exec() being disabled.
Apache is running under it's own user account- if I log in as this user and attempt to run git on the command line I get the expected results. The account also has full permissions to do everything with the /Program Files/Git folder.
If I run exec('git'); on my local machine it works fine, but just won't work on the server.
Any ideas?
When you type 'git' in command-line on Windows, it opens git.cmd. In typical msysgit installation on Windows, git.cmd is in PATH, but git.exe may not be!
So, you can try one of below:
Create a git.bat in Windows folder with following contents:
C:\Program Files (x86)\Git\bin\git.exe (check path)
Add git's bin directory also in Windows PATH. (You can do so by editing system environmental variables)
I've managed to fix this by upgrading from PHP 5.2 to PHP 5.4. Not sure what the issue was, but that has resolved it.
OS: Windows 7, PHP:5.3.2
When I make symlink to the local folder, everything works OK and I can get folder contents.
mklink /D linked_dir c:\real_dir\
Both PHP and cmd.exe dir show me files in linked_dir.
But, when I make symlink to the shared drive
mklink /D linked_dir x:\php\
cmd.exe dir shows the files, and php says:
[function.opendir]: failed to open dir. No such file or directory in ...
Does anyone know how to overcome this issue? is_link, readlink etc... also doesn't provide anything, as if PHP cannot understand directory links at all.
I really need to read by PHP shared folder contents linked to my local working directory.
Problem here might be that the symlink directory is not available or accessible by the www user (the user under which your server runs). Check the permissions of the server acount.
These might be bugs. See the Changlog for PHP 5.3.4
Fixed symbolic resolution support when the target is a DFS share.
Improved support for is_link and related functions on Windows.
Implemented symbolic links support for open_basedir checks.
#51804 SplFileInfo::getLinkTarget() Fails.
So, if possible, upgrade to PHP 5.3.4 and see if that fixes the issue.