You Just Can
The rules have next to nothing to say about this. Concentration (and the Concentratinon rules for casting spells) lists conditions that can cause you to have to roll to keep concentration. If none of those are in effect and your DM doesn't rule that you have some kind of problem, you simply can. No rolls or checks are required simply because the spell takes a long time, the conditions that require a concentration check are listed there.
Food & Water
Food and water are not mentioned as requirements for concentration. They are mentioned under Starvation and Thirst:
Characters might find themselves without food or water and with no
means to obtain them. In normal climates, Medium characters need at
least a gallon of fluids and about a pound of decent food per day to
avoid starvation. (Small characters need half as much.) In very hot
climates, characters need two or three times as much water to avoid
A character can go without water for 1 day plus a number of hours
equal to his Constitution score. After this time, the character must
make a Constitution check each hour (DC 10, +1 for each previous
check) or take 1d6 points of nonlethal damage.
A character can go without food for 3 days, in growing discomfort.
After this time, the character must make a Constitution check each day
(DC 10, +1 for each previous check) or take 1d6 points of nonlethal
Characters who have taken nonlethal damage from lack of food or water
are fatigued. Nonlethal damage from thirst or starvation cannot be
recovered until the character gets food or water, as needed—not even
magic that restores hit points heals this damage.
Unless you have a casting time of 72 hours or are already starving, food is basically never an issue. If you have a Constitution of >= 1 (aka: are alive), water isn't an issue if you remember to drink before starting, even for a 24 hour casting time. Note that this is Constitution score, not modifier. Even a Constitution 2 character can go 26 hours without water before suffering damage.
If you did run into the starvation rules while casting, the rules would trigger a Concentration check as per the casting rules:
If while trying to cast a spell you take damage, you must make a
Concentration check (DC 10 + points of damage taken + the level of the
spell you’re casting). If you fail the check, you lose the spell
without effect. The interrupting event strikes during spellcasting if
it comes between when you start and when you complete a spell (for a
spell with a casting time of 1 full round or more) or if it comes in
response to your casting the spell (such as an attack of opportunity
provoked by the spell or a contingent attack, such as a readied
If you are taking continuous damage half the damage is considered to
take place while you are casting a spell. You must make a
Concentration check (DC 10 + ½ the damage that the continuous source
last dealt + the level of the spell you’re casting). If the last
damage dealt was the last damage that the effect could deal then the
damage is over, and it does not distract you.
Repeated damage does not count as continuous damage.
Nothing in the rules says you have to stand to cast these spells, and nothing in the rules says you can't stand for 24 hours to cast them.
Arcane Spellcasters who cast a 24 hour spell would need to sleep after casting it, then they can regain spells normally.
Divine Spellcasters would have to pray immediately, as per the preparation rules (the first opportunity is after you finish casting, as Divine Casters don't need rest to prepare spells):
A divine spellcaster chooses and prepares spells ahead of time, just
as a wizard does. However, a divine spellcaster does not require a
period of rest to prepare spells. Instead, the character chooses a
particular part of the day to pray and receive spells. The time is
usually associated with some daily event. If some event prevents a
character from praying at the proper time, he must do so as soon as
possible. If the character does not stop to pray for spells at the
first opportunity, he must wait until the next day to prepare spells.